For many beginners, I don't know how to configure Java environment variables, especially in Linux systems. The following small series will introduce you how to configure in Linux. Java environment variables, I hope to help you.
a. Unzip the installation jdk
Enter the directory where the jdk-6u14-linux-i586.bin file is located in the shell terminal,
execute the command. /jdk-6u14-linux-i586.bin At this point, there will be a protocol, and then hit enter, when asked if you agree, enter yes and press Enter. Then a jdk1.6.0_14 directory will be generated in the current directory, you can copy it to any directory.
Two. Environment variables that need to be configured
1. PATH environment variable. The role is to specify the command search path, when the command is executed under the shell, it will look in the path specified by the PATH variable to see if it can find the corresponding command program. We need to add the bin directory under the jdk installation directory to the existing PATH variable. The bin directory contains executable files such as javac/java/javadoc that are often used. After setting the PATH variable, it can be in any directory. Execute tools such as javac/java.
2. CLASSPATH environment variable. The role is to specify the class search path, to use the already written classes, of course, can be found, JVM is to find the class through CLASSPTH. We need to set the dt.jar and tools.jar in the lib subdirectory under the jdk installation directory to the CLASSPATH, of course, the current directory “. ” must also be added to this variable.
3. JAVA_HOME environment variable. It points to the jdk installation directory. Eclipse/NetBeans/Tomcat and other software finds and uses the installed jdk by searching the JAVA_HOME variable.
Three. Three ways to configure environment variables 1. Modify the /etc/profile file
This method is recommended if your computer is only used as a development, because all users' shells have access to these environment variables, possibly Will bring security problems to the system.
· Open /etc/profile
· with a text editor. Add at the end of the profile:
The code is as follows:
export JAVA_HOME=/Usr/share/jdk1.6.0_14
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=. :$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
·Re-login
Previous12Next Total 2 Pages
In the Linux system operation, when using the command, some command lines are very
Linux system files, including folders, will have some permissions. These Linux perm
Simple understanding of the Linux find command is not enough, we also need to know how to use it, th
When compiling in the Linux environment, sometimes ld/;/usr/bin/ld:cannot find -lxx
How does the Linux desktop environment not support HiDPI display?
Linux how to use the cal command to view the calendar
Modify the IP address under Linux
How Linux distinguishes between install command and cp command
How to boot a Linux ISO image file from the hard disk
Steps for Linux to build a static link library
CentOS 6.0 manual upgrade to CentOS 6.2 method
Linux vsftp prompt 530 Permission denied how to do?
How to open a file in a terminal using Linux commands
How Ubuntu builds virtual network card
RSA authentication in Linux login SSH
Win7/win8.1 can not receive the upgrade win10 prompts what is the reason? How to deal with it?
Linux VIM Editor Find and Replace Tutorial
Where is the Win10 offline map?
Only two strokes immediately give the right-click menu "Reduce"
Customize the Win7 power button to shut down or hibernate?
How to use the undo function in Word2003
Win10 UAC dialog box "Yes" can not solve the solution
Win10 will launch a new preview version: more respect for user privacy