Article Directory
-
- 1. Error reporting
- 2. The reason for the error
- 3. Uninstall OpenJDK
- 4. Install OracleJDK offline
-
- 1) Download OracleJDK (version: jdk-11.0.8_linux-x64)
- 2) Create a jdk directory and enter
- 3) Upload the downloaded jdk package to this directory through the rz command or xftp, and decompress it
- 4) Configure environment variables
- 5) Click the keyboard i to edit, and paste the following content to the end;
- 6) Save changes
- 7) Reload the configuration file, command:
- 5. Check whether the JDK is installed successfully
- 6. Modify the jdk configuration of jenkins
1. Error reporting
jenkins build error
package javafx.util does not exist
2. The reason for the error
The code finds that the javafx class is used, which only exists in OracleJDK and does not exist in OpenJDK.
The jenkins server is installed with openjdk
3. Uninstall OpenJDK
Not outlined in detail
4. Install OracleJDK offline
1) Download OracleJDK (version: jdk-11.0.8_linux-x64)
https://pan.quark.cn/s/a1d4221104c8
2) Create a jdk directory and enter
mkdir -p /usr/local/jdk
cd /usr/local/jdk
3) Upload the downloaded jdk package to this directory through the rz command or xftp, and decompress it
tar -zxvf jdk-11.0.8_linux-x64_bin.tar.gz
4) Configure environment variables
vim /etc/profile
5) Click the keyboard i to edit, and paste the following content to the end;
export JAVA_HOME=/usr/local/jdk/jdk-11.0.8
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
Note that /usr/local/jdk/jdk-11.0.8 is your own jdk directory
6) Save changes
Esc
:wq
7) Reload the configuration file, command:
source /etc/profile
5. Check whether the JDK is installed successfully
java -version
6. Modify the jdk configuration of jenkins
Manage Jenkins -> Global Tool Configuration -> JDK