-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjava-class.linux.nexss.config.js
59 lines (54 loc) · 1.92 KB
/
java-class.linux.nexss.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
let languageConfig = Object.assign({}, require(`./java.win32.nexss.config`));
const sudo = process.sudo;
const distName = process.distro;
languageConfig.dist = distName;
languageConfig.compilers = {
java8: {
install: `${sudo}apt install openjdk-8-jdk`,
command: "java",
args: `-Dfile.encoding=UTF-8 -cp '.:./lib/*:src/lib/*' <fileNoExt>`,
help: ``,
},
java13: {
install: `${sudo}apt install openjdk-13-jdk`,
command: "java",
args: `-cp '.:lib/*:src/lib/*' <fileNoExt>`,
help: ``,
},
};
switch (distName) {
case process.distros.ORACLE:
languageConfig.compilers.java8.install = `${sudo}yum install -y java-1.8.0-openjdk java-devel`;
break;
case process.distros.AMAZON:
case process.distros.AMAZONAMI:
languageConfig.compilers.java8.install = `${sudo}yum install -y java-1.8.0-openjdk java-devel`;
break;
case process.distros.ALPINE: // add java-devel??
languageConfig.compilers.java8.install = `${sudo}apk add openjdk8
JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk
PATH = "$JAVA_HOME/bin:\${PATH}"
${sudo}ln -sf /usr/lib/jvm/java-1.8-openjdk/bin/javac /usr/bin/javac`;
break;
case process.distros.DEBIAN:
languageConfig.compilers.java8.install = `${sudo}apt install -y openjdk-11-jdk`;
break;
case process.distros.CENTOS:
case process.distros.FEDORA:
languageConfig.compilers.java8.install = process.replacePMByDistro(
`${sudo}apt-get install -y java java-devel`
);
break;
case process.distros.ARCH:
languageConfig.compilers.java8.install = `${sudo}pacman -S --noconfirm jre-openjdk jdk-openjdk`; // error: package org.json does not exist
break;
default:
languageConfig.compilers.java8.install = process.replacePMByDistro(
languageConfig.compilers.java8.install
);
languageConfig.compilers.java13.install = process.replacePMByDistro(
languageConfig.compilers.java13.install
);
break;
}
module.exports = languageConfig;