Configuring the JDK
The Java Profiler is deployed using the non-interactive shell and depends on JDK 8 or later (excluding JRE 8 or JRE 11).
After JAVA_HOME is configured, if the JDK version is JDK 8, configure the correct tools.jar path in the CLASSPATH environment variable. You can run the find / -name tools.jar command to query the directory. Then add CLASSPATH=/PATH/lib/tools.jar to the configuration file (/etc/environment or ~/.bashrc) and make the configuration take effect.
- Check whether the JDK is installed.
Run the java -version or which java command.
If the JDK is not installed, install or upload the JDK file of a qualified version. If the Java version is earlier than 1.8, use JDK 8 or later.
- Configure the JAVA_HOME environment variable.
- On Debian, Ubuntu, UOS 20, or Linx, upload the JDK file to the server and add the following content to the /etc/environment file:
1export JAVA_HOME=/usr/jdk/jdk1.8.0
In the preceding command, replace /usr/jdk/jdk1.8.0 with the actual absolute path of the JDK file.
Run the following command to apply the JAVA_HOME configuration:
1source /etc/environment
- On CentOS, EulerOS, openEuler, NeoKylin, Kylin V10, or SUSE, upload the JDK file to the server. Configure JAVA_HOME in the ~/.bashrc file. If the ~/.bashrc file does not exist, you can run the touch ~/.bashrc command to create the file and add the following content to the file:
1export JAVA_HOME=/usr/jdk/jdk1.8.0
In the preceding command, replace /usr/jdk/jdk1.8.0 with the actual absolute path of the JDK file.
Run the following command to apply the JAVA_HOME configuration:
1source ~/.bashrc
- On Debian, Ubuntu, UOS 20, or Linx, upload the JDK file to the server and add the following content to the /etc/environment file:
- Verify the JDK configuration.
1java -version