Java's ubuntu12.04 development environment preparation

Source: Internet
Author: User

Configure the Java development environment, which is to install the JDK:

1, configuration environment variables, change/etc/profile file: sudo gedit/etc/profile;

At the end of the file add the following lines (in fact, the same as the configuration principle under Windows, but the expression is different):

Export java_home=/usr/java/jdk1.8.0_25
Export path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH
Export classpath= $CLASSPATH:.: $JAVA _home/lib: $JAVA _home/jre/lib

2. Change the default configuration option and execute the following command sequentially

Without step 2, step 1 is only the environment variable that configures the JDK for the current user

sudo update-alternatives--install/usr/bin/java Java/usr/java/jdk1.8.0_25/bin/java 300
sudo update-alternatives--install/usr/bin/jar Jar/usr/java/jdk1.8.0_25/bin/jar 300
sudo update-alternatives--install/usr/bin/javah javah/usr/java/jdk1.8.0_25/bin/javah 300
sudo update-alternatives--install/usr/bin/javap JAVAP/USR/JAVA/JDK1.8.0_25/BIN/JAVAP 300

3. Test Run Java-version

The installation succeeds as follows:

Java Version "1.7.0_07"
Java (TM) SE Runtime Environment (build 1.7.0_07-B10)
Java HotSpot (TM) Server VM (build 23.3-b01, Mixed mode)

Finally, configure eclipse (the following)

sudo gedit /usr/share/applications/eclipse.desktop

Fill in the text:

[Desktop Entry]
Name=Eclipse
Comment=Eclipse IDE
Exec=/Opt/Eclipse/eclipse
icon=/opt/eclipse/ ICON.XPM
terminal=false
type=application
categories=application;development;

Then go to the/opt/directory to build Eclipse's shortcut desktop (same as Windows).

It is recommended to pin it directly to the starter.

Java's ubuntu12.04 development environment preparation

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.