How to install JDK in ubuntu-general Linux technology-Linux programming and kernel information. Ubuntu comes with the jdk1.4 Development Kit. Recently I learned JAVA and need to access many new classes in 1.5 and 1.6. For example, I have to download and configure j2sdk1.6. There are many methods on the forum, here, I will summarize my experiences in installation and configuration:
First use sudo apt-get install sun-java-jdk6 to download the Development Kit
The default download path is/usr/lib/jvm/java-6-sun.
Next we need to configure the system.
Two files are involved. One is/etc/environment, the other is/etc/profile, the other is the environment variable, and the other is the system startup to load the index,
Type the command: sudo gedit/etc/environmetn
Configure the path:
JAVA_HOME =/usr/lib/jvm/java-6-sun
PATH = $ PATH:/usr/lib/jvm/java-6-sun/bin
CLASSPATH =.:/usr/lib/jvm/java-6-sun/lib
Restart the computer. At this time, you must restart the desktop. You cannot control + backspace to restart desktop x.
After restart, you can configure the default java
Type the command: sudo update-alternatives -- config java
Select the serial number corresponding to java in the latest java-6-sun path
At this time, the configuration is complete.
Run java-version to check the version.
Command which java check path
OK, finished. You can write the program under jdk1.6.
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