Это старая версия документа.


Installation Oracle JDK

1. Download the latest jdk from http://www.oracle.com/technetwork/java/javase/downloads/index.html

2. Unpack to /usr/lib/jvm

3. Create symbolic link java-current:

ln -s /usr/lib/jvm/jdk1.7.0_11 /usr/lib/jvm/java-current

4. Add to .bashrc:

export JAVA_HOME=/usr/lib/jvm/java-current
export PATH=$PATH:$JAVA_HOME/bin

5. Delete links to old java versions:

mv usr/lib/jvm usr/lib/jvm1
cd /usr/bin - delete all broken links
cd /etc/alternatives - delete all broken links
mv usr/lib/jvm1 usr/lib/jvm

6. Add global link to java:

rm /usr/bin/java
ln -s /usr/lib/jvm/java-current/bin/java /usr/bin/java

Installing Sun JDK under Ubuntu 10.4 steps:

  1. Open the Application Center.
  2. Main menu / Application sources
  3. Page - Other Software
  4. Check - «http://archive.canonical.com/ubuntu lucid patner»
  5. Close
  6. Go to the Application Center main window page Patners Canonical, use search field for «jdk».

Installing Java 7 on Ubuntu

ln -s java-7-sun-1.7.0 java-7-sun
  • Get the last number in the list:
sudo update-alternatives --config java
  • Add new jdk to the list:
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-7-sun/jre/bin/java 3
  • Choose new jdk by typing it's number:
sudo update-alternatives --config java
  • Check version:
java -version

How to make Sun JVM default Java Machine:

A. We have to replace symlink /etc/alternatives/java.

  1. Delete current OpenJDK symlink
  2. Using Midnight Commander open directory /etc/alternatives/ from one side
  3. and pose cursor on file /usr/lib/jvm/java-6-sun/jre/bin/java
  4. Make symlink: Ctrl+x, s.

or: B. More elegant way:

sudo update-alternatives --config java

and select the option that has the path /usr/lib/jvm/java-6-sun/jre/bin/java

dev/ubuntu/sun_jdk.1367986055.txt.gz · Последние изменения: 2013/05/08 08:07 — jamis7005
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0