How to install jdk in ubuntu
2013-06-09 15:47
585 查看
From : http://www.blogs.digitalworlds.net/softwarenotes/?p=41
Install Java JDK 7 on Ubuntu 12.04 (JavaFX is included in the installation)
Posted by ig on Jan 28, 2013 in Java, JavaFX, Ubuntu | 40 commentsThis package provides Oracle Java JDK 7 (which includes JRE, the Java browser plugin and JavaFX). However, you can’t only install Oracle JRE – the PPA only provides the full Oracle JDK7 package.
1. To add our PPA and install the latest Oracle Java (JDK) 7 in Ubuntu, use the commands below:
#sudo add-apt-repository ppa:webupd8team/java
#sudo apt-get update && sudo apt-get install oracle-jdk7-installer
2. After the installation you have enable the jdk:
#update-alternatives –display java
3. Check if Ubuntu uses Java JDK 7
#java -version
If all went right the answer should be something like this:
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)
4. Check what compiler is used:
#javac -version
The correct answer should be like this:
javac 1.7.0_07
5. Adding JAVA_HOME to environment
Edit /etc/environment and add JAVA_HOME=/usr/lib/jvm/java-7-oracle to the end of the file.
First open a Terminal (Applications → Accessories → Terminal), then enter:
#sudo gedit /etc/environment
Append to the end of the file:
JAVA_HOME=/usr/lib/jvm/java-7-oracle
6. Removing Oracle JDK 7
If you don’t want to use Oracle Java (JDK) 7 anymore and want to go back
to OpenJDK, all you have to do is remove the Oracle JDK7 Installer and
the previous Java (OpenJDK, etc.) version will be used:
#sudo apt-get remove oracle-jdk7-installer
相关文章推荐
- How To Install Oracle Java 7 (JDK) In Ubuntu(or linuxdeepin12)
- How To Install Oracle Java 7 (JDK) In Ubuntu
- How to install sun-java5-jdk in Ubuntu 11.04
- 【Ubuntu手记】 How to install jdk in Ubuntu 11.10
- how to install chinses input method--fcitx in ubuntu
- how to install oracle jdk 7 on ubuntu lucid lts 10.04
- How to Install JAVA 8 (JDK 8u40) on Ubuntu & LinuxMint Via PPA
- How to Install JAVA 8 (JDK 8u91) on Ubuntu & LinuxMint via PPA
- How to install JDK in AIX?
- How to install WebObjects in Ubuntu for free(II)
- [Ubuntu]How to install Google Chrome in Ubuntu
- How to install opencv in Ubuntu
- How to install OpenGrok in ubuntu 14?
- linux 机器之间 zssh, rz, sz互相传输 ( How to install zssh in Ubuntu 13.10 (Saucy))
- How to Install Wine 1.8 Stable via New PPA in Ubuntu
- How to install Ubuntu form the ISO format in the GRUB
- How to Install And Configure Apache In Ubuntu
- How to install sun-java5-jdk on Ubuntu 9.10
- Ubuntu 14.04 – How to install xrdp in Ubuntu 14.04
- How to Install Oracle Java JDK on Ubuntu Linux