Skip to content
Snippets Groups Projects
Commit bfdbe00e authored by Markus Alexander Kuppe's avatar Markus Alexander Kuppe
Browse files

Install Oracle JDK 8 if doJFR requested.

See previous commit for context.

With OpenJDK 11 this won't hopefully
be no issue anymore.
(http://openjdk.java.net/jeps/328)

[Bug][Toolbox]
parent 969b7e52
Branches
Tags
No related merge requests found
...@@ -278,21 +278,21 @@ public class CloudDistributedTLCJob extends Job { ...@@ -278,21 +278,21 @@ public class CloudDistributedTLCJob extends Job {
// Send remote TLC's stdout to local stdout (this throws a TransportException // Send remote TLC's stdout to local stdout (this throws a TransportException
// unless shutdown is postponed by a few minutes above). // unless shutdown is postponed by a few minutes above).
ByteStreams.copy(channel.getOutput(), System.out); ByteStreams.copy(channel.getOutput(), System.out);
// if (doJfr) { if (doJfr) {
// // Get Java Flight Recording from remote machine and save if to a local file in // Get Java Flight Recording from remote machine and save if to a local file in
// // the current working directory. We call "cat" because sftclient#get fails with // the current working directory. We call "cat" because sftclient#get fails with
// // the old net.schmizz.sshj and an update to the newer com.hierynomus seems // the old net.schmizz.sshj and an update to the newer com.hierynomus seems
// // awful lot of work. // awful lot of work.
// channel = sshClient.execChannel("cat /mnt/tlc/tlc.jfr"); channel = sshClient.execChannel("cat /mnt/tlc/tlc.jfr");
// final InputStream output = channel.getOutput(); final InputStream output = channel.getOutput();
// final String cwd = Paths.get(".").toAbsolutePath().normalize().toString() + File.separator; final String cwd = Paths.get(".").toAbsolutePath().normalize().toString() + File.separator;
// final File jfr = new File(cwd + "tlc.jfr"); final File jfr = new File(cwd + "tlc.jfr");
// ByteStreams.copy(output, new FileOutputStream(jfr)); ByteStreams.copy(output, new FileOutputStream(jfr));
// if (jfr.length() == 0) { if (jfr.length() == 0) {
// System.err.println("Received empty Java Flight recording. Not creating tlc.jfr file"); System.err.println("Received empty Java Flight recording. Not creating tlc.jfr file");
// jfr.delete(); jfr.delete();
// } }
// } }
// Finally close the ssh connection. // Finally close the ssh connection.
sshClient.disconnect(); sshClient.disconnect();
monitor.subTask("TLC model checker process finished"); monitor.subTask("TLC model checker process finished");
...@@ -547,6 +547,8 @@ public class CloudDistributedTLCJob extends Job { ...@@ -547,6 +547,8 @@ public class CloudDistributedTLCJob extends Job {
+ " && " + " && "
+ params.getHostnameSetup() + params.getHostnameSetup()
+ " && " + " && "
// Oracle Java 8
+ (doJfr ? "add-apt-repository ppa:webupd8team/java -y && " : "/bin/true && ")
// Accept license before apt (dpkg) tries to present it to us (which fails due to 'noninteractive' mode below) // Accept license before apt (dpkg) tries to present it to us (which fails due to 'noninteractive' mode below)
// see http://stackoverflow.com/a/19391042 // see http://stackoverflow.com/a/19391042
+ "echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections && " + "echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections && "
...@@ -594,6 +596,8 @@ public class CloudDistributedTLCJob extends Job { ...@@ -594,6 +596,8 @@ public class CloudDistributedTLCJob extends Job {
+ "apt-get install --no-install-recommends mdadm e2fsprogs screen zip unattended-upgrades " + "apt-get install --no-install-recommends mdadm e2fsprogs screen zip unattended-upgrades "
+ params.getExtraPackages() + " -y" + params.getExtraPackages() + " -y"
+ " && " + " && "
+ (doJfr ? "apt-get install --no-install-recommends oracle-java8-installer oracle-java8-set-default -y " : "/bin/true")
+ " && "
// Delegate file system tuning to cloud specific code. // Delegate file system tuning to cloud specific code.
+ params.getOSFilesystemTuning() + params.getOSFilesystemTuning()
// Install Oracle Java8. It supports Java Mission // Install Oracle Java8. It supports Java Mission
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment