The following method is used only in Ubuntu10.10 and has been tested successfully. bash is used in Ubuntu. Therefore, we cannot generalize the following method: vi ~ /. Bashrc (in general mode, you do not need to enter any file path) to add environment variables (assuming the jdk installation path is/usr/local/jdk) (The following content is edited using vi, very troublesome. Please check the Linuxvi operation manual on your own)
The following methods have been successfully tested only in the Ubuntu 10.10 environment:
Bash is used in Ubuntu, so it cannot be generalized.
Here are my Solutions
Vi ~ /. Bashrc (in general mode, no file path is required)
Add environment variables (assuming the jdk installation path is/usr/local/jdk)
(The following content is edited using vi, which is very troublesome. Please check the Linux vi operation manual by yourself)
Export JAVA_HOME =/usr/local/jdk
Export PATH = $ PATH: $ JAVA_HOME/bin
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar