Although JDK environment variables have been configured many times before, they are all configured by others.CodeIt is not until this time that a problem occurs that you have to think about why this configuration is required.
If you use JDK in the system, the path must be configured as follows:
# Vi/etc/profile
Add the following content at the end:
# Set Java-JDK Environment
Java_home =/opt/jdk1.6.0 _ 21
# It doesn't matter whether classpath is placed before and after it is put, it means that if other jar is needed for compilation, search in this path
Classpath =.: $ classpath: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
#Path
It must be called during Java compilation.Program(Such as Java and javac)
# Path must be followed, because when we issue the command, the system will search by path specified by path until the location is found,
# If you put it in front of the page, search for the built-in Java in the system, regardless of the Configuration. Remember, it indicates the meaning of the current path.
Path =.: $ java_home/bin: $ path
Export java_home classpath path