Configure the JAVA environment for Ubuntu-general Linux technology-Linux programming and kernel information. The following is a detailed description. This article is the first of the [JAVA development topic] With the content "Configuring the JAVA environment for Ubuntu". This JAVA topic is intended for users who want to develop JAVA software under Ubuntu, and also for users who want to transfer JAVA Development under Windows to development under Ubuntu. No more nonsense. The text begins:
Operating system version: Ubuntu 7.10 Gutsy
JAVA version: JAVA 6
Installing the Java Virtual Machine and SDK in Ubuntu is very easy:
Enter commands on the terminal when connected
$ Sudo apt-get install sun-java6-jre sun-java6-sdk
This command can help you download and install JAVA 6. By the way, you can install JAVA support in the browser:
$ Sudo apt-get install sun-java6-plugin
After installing the three variables, you need to write the system variables:
$ Sudo gedit/etc/environment
Write the following two lines in the Text Editor:
We also need to adjust the priority of system virtual machines:
$ Sudo gedit/etc/jvm
Write the following sentence at the top of the Text Editor:
/Usr/lib/jvm/java-6-sun
Enter the following command in the terminal:
$ Java-version
The terminal should return the following words:
Java version "1.6.0 _ 03"
Java (TM) SE Runtime Environment (build 1.6.0 _ 03-b05)
Java HotSpot (TM) Server VM (build 1.6.0 _ 03-b05, mixed mode)
This indicates that the JAVA environment has been established. You can use a text editor to write a JAVA HelloWorld! The program executes javac compilation and java to explain the execution and see the result.
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.