1. Uninstall the JDK that comes with Linux system
We want to delete the JDK environment
Check again if it has been deleted
2. Install the JDK you downloaded
2.1 Download JDK, address: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Using a 32-bit Linux system, so 32-bit downloaded, you can use the command to query whether it is 32-bit or 64-bit
2.2 Upload the JDK to the server and unzip it into the directory you created.
Unzip JDK to /usr/local/java below
3. Configure environment variables
3.1 Editing linux environment variable files
Press i to insert
3.2 Adding Java variable environment
Press Esc to exit editing mode, enter: wq to save
3.3 Save the variable file and reload the variable
Entering the java command will prompt
Reload the environment variable configuration file
4. Test whether the installation is successful
Execute java,javac
Summarize
The above is the linxu system Java environment configuration introduced to you by the editor. I hope you will be helpful. If you have any questions, please leave me a message. The editor will reply to you in time!