Oracle (Sun) Java 6 Installer Available For Ubuntu And Debian Users [PPA]
|
|
|
As you know, we maintain a PPA
repository which hosts Oracle Java 7 and 8 installers for Ubuntu and
Debian users. WebUpd8 reader Eugene San has modified the package to
install Oracle (Sun) Java 6, which is required for Android development,
and he has asked us to upload it to our Java PPA.
So you can now install Oracle Java 6 (includes JDK and JRE) in Ubuntu or Debian using the WebUpd8 Java PPA repository.
The advantage of
using our PPA over manually installing Oracle Java 6 is that we provide
updates so instead of having to check every now and then to see when a
new Java version is released and install it manually, you can simply use
our PPA and get automatic updates.
The WebUpd8 Oracle Java
repository doesn't host any Java files, because that's not allowed by
the new Oracle Java license. Instead, the package uses a script which
downloads and installs Oracle Java 6.
Install Oracle Java 6 in Ubuntu via PPA
The current JDK version in the PPA is Oracle Java SE 6 Update 38 (7u38).
To add the WebUpd8 Java PPA and
install Oracle Java 6, which includes JDK, JRE and the browser plugin in
Ubuntu (and other Linux distributions based on Ubuntu such as Linux
Mint, etc.), use the following commands:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java6-installer
Currently, the are packages for Ubuntu Raring, Quantal, Precise, Oneiric, Natty, Maverick and Lucid.
Using the same PPA you can also install Oracle Java 7 or Oracle Java 8.
Install Oracle Java 6 in Debian using our PPA repository
Debian users can add the WebUpd8 Oracle Java repository and install Oracle Java 6 using the commands below:
su -
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get update
apt-get install oracle-java6-installer
exit
Setting Java environment variables
To automatically set up the Java environment variables, you can install the following package:
sudo apt-get install oracle-java6-set-default
If you've already installed oracle-java7-set-default or oracle-java8-set-default, they will be automatically removed when installing oracle-java6-set-default (and the environment variables will be set for Oracle Java 6 instead)
Install Oracle Java 8 (JDK8 and JRE8) in Ubuntu / Linux Mint
Important: Ubuntu 13.04 and 12.10 are no longer supported by Canonical: there will be no security updates and they don't allow uploading new packages to Launchpad PPAs!
The installer provides Oracle Java 8
(which includes Java JDK, JRE and the Java browser plugin). However, you
can't only install Oracle JRE - the PPA only provides the full Oracle
JDK8 package.
Our PPA supports Ubuntu 14.04, 13.10, 12.04 and 10.04 as well as the corresponding Linux Mint versions. Add the PPA and install Oracle Java 8 (the package provides both JDK8 and JRE8) using the following commands:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
Once installed, running "java -version" in a terminal should output something like this:
andrei@andrei-desktop:~$ java -version
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)
Or, "javac -version":andrei@andrei-desktop:~$ javac -version
javac 1.8.0
And so on.Automated installation (auto accept license)
The installer requires you to accept
the Oracle license before the installation begins. This is only required
once. If for some reason you need the installation to be automated, you
can run the following command to automatically accept the Oracle
license:
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
Switching between Oracle Java 8 and Java 7
Later on, if you want to switch Oracle
Java 7, use the following command (make sure "oracle-java7-installer"
package is installed):
sudo update-java-alternatives -s java-7-oracle
And, switch back to Oracle Java 8 using:
sudo update-java-alternatives -s java-8-oracle
If you get some warnings when running these two commands, ignore them.Setting Java environment variables
To automatically set up the Java 8 environment variables, you can install the following package:
sudo apt-get install oracle-java8-set-default
If you've already installed oracle-java6-set-default or oracle-java7-set-default, they will be automatically removed when installing oracle-java8-set-default (and the environment variables will be set for Oracle Java 8 instead).



Tidak ada komentar:
Posting Komentar