Monday, March 19, 2012

Debian: install sun java

Default installation of debian surely give you not the sun java available...
If you give
java -version
something like this is the results....:
 java version "1.5.0"
gij (GNU libgcj) version 4.4.5
[........]

So now we move to install sun java package, and set the java command to the new package installed.....
Please ensure you have into /etc/apt/sources.list file non-free rows for your distribution.
If no(in my case I use squeeze) add the follows:

deb http://ftp.it.debian.org/debian/ squeeze non-free
deb-src http://ftp.it.debian.org/debian/ squeeze non-free

Next
apt-get update
apt-cache search sun-java6
and this result will prompt to you....:
.....
sun-java6-bin - Sun Java(TM) Runtime Environment (JRE) 6 (architecture dependent files)
sun-java6-demo - Sun Java(TM) Development Kit (JDK) 6 demos and examples
sun-java6-fonts - Lucida TrueType fonts (from the Sun JRE)
sun-java6-javadb - Java(TM) DB, Sun Microsystems' distribution of Apache Derby
sun-java6-jdk - Sun Java(TM) Development Kit (JDK) 6
sun-java6-jre - Sun Java(TM) Runtime Environment (JRE) 6 (architecture independent files)
sun-java6-plugin - The Java(TM) Plug-in, Java SE 6
sun-java6-source - Sun Java(TM) Development Kit (JDK) 6 source files
....

So give the follow:
apt-get install sun-java6-jdk
if you are a developer, and you need the jdk....
Or the jre if you want only the runtime enviroment...
apt-get install sun-java6-jre

At the end of installation give this last command
update-java-alternatives -s java-6-sun
to set to java command the right(and new) path....
 
Run 
java -version 
to look this...:
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
[...]

Bye....
 






No comments:

Post a Comment