Start java environment variable configuration and eclipse configuration in linux utuntu

Source: Internet
Author: User
Linux utuntu java environment variable configuration and eclipse configuration start-Linux general technology-Linux programming and kernel information, the following is a detailed reading. Recently, I want to verify whether the even talend component can run across windows platforms. After a few twists and turns, the basic environment can be completed. Check whether there are too many solutions to the latest JDK and eclipse installation and configuration in the linux environment, especially in utuntu, and learn how to make a simple task to influence the confidence of a person. To solve the pain of beginners, I would like to share this small achievement with you. (In addition, although there is a way for utuntu to find the eclipse Automatic Installation configuration in sourcelist, it is better for beginners to do more operations)

1. jdk installation and java environment variable configuration

(1). download the latest jdk linux version, such as jdk-6u7-linux-i586.bin, and then execute the sh jdk-6u7-linux-i586.bin command at terminal (if there is no permission, add chmod + x jdk-6u7-linux-i586.bin first)

(2) decompress the package to the current directory. You can rename the folder or move it to another directory.

(3). Configure environment variables, similar to those in windows.

Generally, three variables are configured:

-PATH: Specifies the command search PATH.
-CLASSPATH: Specifies the Class search path. dt. jar and tool. jar in the lib subdirectory under the jdk installation directory are set to CLASSPATH, and the current directory "."
-JAVA_HOME indicates the JDK installation directory.

In addition, there are three configuration methods (You need to log on again after completion ):

-Modify the/etc/profile file. All Users have the right to use these environment variables. You can use this method during development and use. Add the following content after the file, for more information about how to edit a file, see the following method:

JAVA_HOME =/usr/share/jdk1.5.0 _ 05
PATH = $ JAVA_HOME/bin: $ path classpath =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export JAVA_HOME
Export PATH
Export CLASSPATH

Note: Do not leave invalid characters (such as tabs) before each line. It doesn't matter if spaces exist)

-Modify the. bashrc file in the user directory. It can control the permission usage to the user level and add the following at the end of the file:

Set JAVA_HOME =/usr/share/jdk1.5.0 _ 05
Export JAVA_HOME
Set PATH = $ JAVA_HOME/bin: $ PATH
Export PATH
Set CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export CLASSPATH

-Directly set the variable in shell. Changing a shell will be ineffective, but it is only a temporary use. Run the following command:

Export JAVA_HOME =/usr/share/jdk1.5.0 _ 05
Export PATH = $ JAVA_HOME/bin: $ PATH
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar

(4) Compile a simple java class to verify whether the configuration is successful!

2. After JDK is installed, install ECLIPSE again:

(1) download eclipse linux platform package eclipse-SDK-3.4-linux-gtk.tar.gz, address is: http://www.eclipse.org/downloads... tar.gz & export _id = 40

(2) decompress the SDK:
Command: tar-zxvf eclipse-SDK-3.4-linux-gtk.tar.gz

(3) Test Run eclipse

-> Directly run eclipse and it will be suspended.
Command:./eclipse found exceptions

[
Java. io. FileNotFoundException:/home/tao/eclipse/configuration/org. eclipse. osgi/. manager/. fileTableLock (No such file or directory)
]

-> The file is not found. Is it a permission issue? Run again
Command: sudo. /There is still an exception in eclipse. the pop-up dialog prompts that the matching jre cannot be found, that is, the unsupported JVM. Why not? JDK has already been configured as an environment variable. Why cannot it be found?

-> Specify it, as shown in the following code:
Command: sudo./eclipse-vm $ JAVA_HOME/jre cannot be found
Try again: sudo./eclipse-vm $ JAVA_HOME still cannot be found
Try again: sudo./eclipse-vm $ JAVA_HOME/bin OK !!!
Or: sudo./eclipse-vm $ JAVA_HOME/bin/java OK !!!

PS: Some plugins do not seem to function properly when running Eclipse normally, such as BIRT. Running Eclipse with the following options may fix the plugin:
Eclipse-vm $ JAVA_HOME/bin/java-ws gtk
Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.