My machine is Mac OS X, I use DBeaverEE (DBeaver Enterprise Edition), so I need to configure JDK11 version by myself, but I don’t want to give up the JDK1.8 I’m using, so I have installed JDK of two versions and can switch freely

steps

1. Download JDK11 from the official website

Directory to/Library/Java/JavaVirtualMachines/JDK – 11.0.11. JDK, in the/Library/Java/JavaVirtualMachines directory has all the JDK version

2. Configure environment variables

[bxy@Yu]Desktop$ cd ~
[bxy@Yu]~$ open .bash_profile
Copy the code

Edit the environment variable file

# Java export JAVA_8_HOME = / Library/Java/JavaVirtualMachines jdk1.8.0 _241. JDK/Contents/Home export JAVA_11_HOME = / Library/Java/JavaVirtualMachines/JDK - 11.0.11. JDK/Contents/Home # default JDK1.8 export JAVA_HOME = $JAVA_8_HOME # The alias command dynamically switches the JDK version alias jdk8="export JAVA_HOME=$JAVA_8_HOME" alias jdk11="export JAVA_HOME=$JAVA_11_HOME" export CLASS_PATH=$JAVA_HOME/lib export PATH=$PATH:$JAVA_HOME/binCopy the code

Enable environment variables

[bxy@Yu]~$ source .bash_profile
Copy the code

3. Verify