3

How can I run an application with a specific Java version? I have three Java versions intstalled:

myuser@mysystem:~$ sudo update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      auto mode
* 1            /opt/jdk-9.0.4/bin/java                          1         manual mode
  2            /opt/jdk1.8.0_162/bin/java                       1         manual mode
  3            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1081      manual mode

I have Java 9 set as default and I'd like to keep it that way. Still, an application named pdfsam doesn't seem to work properly with Java 9. What command is necessary to run it with openjdk (option 3)?

Socrates
  • 2,473
  • Normally, right after the choices are displayed, the message below is also displayed Press to keep the current choice [*], or type selection number: as you can see, it explains that the line marked by a star (*) and the choice activated by default, and if you want to change it, you just have to enter the number of the selection and click on <enter> – Nimpo Apr 29 '18 at 20:13
  • That's exactly what I described not to want, as I wanna keep Java 9 as default. The reason is that most of my applications run well on Java 9, except pdfsam, that runs best on OpenJDK 8 and NetBeans that also only runs on Java 8. I though best would be a parameter at execution time to tell what Java version to pick. But couldn't find such an option. I have the feeling there is no such option. – Socrates Apr 29 '18 at 20:24
  • 2

0 Answers0