Configure java environment variables and Eclipse in Linux
Source: Internet
Author: User
In Linux, configure the java environment variables and Eclipse configurations-general Linux technology-Linux programming and kernel information. For more information, see the following. 1. Go to java.sun.com/j2se/1.4.2/download.html "> download a Linux Platform JDK,
It is recommended to download RPM in self-extracting file (j2sdk-1_4_2_06-linux-i586-rpm.bin) in RPM in self-extracting format );
2. Upload the file to a Linux server and run the following command in shell:
Of course, this setting of environment variables takes effect only for the current shell. If you log on from another shell, you cannot use the variable you just set. So the best way is to modify the. bashrc file.
[Root @ LinuxServer rpm] # vi. bashrc
Set JAVA_HOME =/usr/java/j2sdk1.4.2 _ 11
Export JAVA_HOME
Set PATH = $ PATH: $ JAVA_HOME/bin
Export PATH
Set CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export CLASSPATH
Of course, you can also change the/etc/profile. However, this setting is not recommended because it will take effect for your shell and affect system security. Add the following at the end of the file:
Export JAVA_HOME =/usr/java/j2sdk1.4.2 _ 11
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export PATH = $ PATH: $ JAVA_HOME/bin
Next, verify whether the variable settings take effect (#### Note: log out before verification, and then log on again );
[Root @ LinuxServer rpm] # echo $ JAVA_HOME
/Usr/java/j2sdk1.4.2 _ 11/
[Root @ LinuxServer rpm] # echo $ CLASSPATH
/Usr/java/j2sdk1.4.2 _ 11/lib/dt. jar:/usr/java/j2sdk1.4.2 _ 11/lib/tools. jar
Set CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export CLASSPATH
7. Now, JDK installation on Linux is complete. Install eclipse-sdk-3.0-linux-gtk.zip at www.eclipse.org to download a eclipse3.0. unzip eclipse-sdk-3.0-linux-gtk.zip to/opt.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.