B4J Question OpenJDK11 on Debian 9

PatrikCavina

Active Member
Licensed User
Longtime User
I'm building a virtual machine with debian 9 to use like VPS.
I'm trying to install openJDK11 but i can't find the package and a good tutorial to install it and run apps compiled with openJDK 11.
Has anyone managed to install openjdk11 on a debian machine?
If so, please explain how you did it
Thanks
 

PatrikCavina

Active Member
Licensed User
Longtime User
I downloaded and extracted it with command "tar xvf openjdk-11.0.2_linux-x64_bin.tar.gz" in folder: /opt/java.
I set the environment variable JAVA_HOME with the location of java folder and i've added it to PATH variable.

export JAVA_HOME="/opt/java/jdk-11.0.2"
export PATH=$PATH:$JAVA_HOME/bin

But if i run command: java -version, this is the result:
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-2~deb9u1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

Instead if i run command: javac -version, this is the result:
javac 11.0.2

Any Tips?
 
Last edited:
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
Sorry I meant this bit on the page

2. Update Java alternative path :
$ sudo update-alternatives --config java


Also there is no jre for Java 11
 
Upvote 0

PatrikCavina

Active Member
Licensed User
Longtime User
Can i set OpenJDK 11 (for linux) as default?
Or i must set JAVA_HOME environment variable to point to jdk-11.0.1, and run all jar programs with command "$JAVA_HOME/bin java -jar filename.jar"?
 
Upvote 0
Top