Geek.Like.Todd

Sun Java and Debian 6 Squeeze —

Sun Java is available thru the Non-Free Repo for Squeeze, to add it you must add

deb http://ftp.us.debian.org/debian/ squeeze main non-free
to your /etc/apt/sources.list file. If I’ve never been clear about how to do that you must open the file as sudo or root in any text editor.

Once this is done you update your apt with sudo apt-get update

Then essentially you type sudo apt-get install sun-java6-jdk for the Java Dev Kit or choose sun-java6-jre if you just want the JRE for the use of Java.. I tend to pick the JDK because a few apps like it over the JRE.

Note: You can test your Java version with java -version and if you don’t get a Sun Version of Java as a reply then you need to type this: sudo update-alternatives --config java and select the newly installed java which is something like…
There are 2 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/gij-4.4 1044 auto mode
1 /usr/bin/gij-4.4 1044 manual mode
2 /usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode

and in my case I chose # 2

You should be good to go now.. keep in mind this is just java.. if you want the plugin it’s sudo apt-get install sun-java6-plugin sun-java6-fonts


0

Categorised as: Geeking Out | Linux | Squeeze


6 Comments

  1. […] I wrote up a document on installing Java on Debian 6 here. […]

  2. Guy says:

    Many Thanks 🙂

  3. […] http://blog.geekliketodd.com/archives/876 1. add this to your /etc/apt/sources.list file: deb http://ftp.us.debian.org/debian/ squeeze main non-free 2. Update your apt with: sudo apt-get update 3. You can test your Java version with: java -version 4. If you successfully got the Sun Java JRE (or OpenJDK JRE will also work), then get the plugin: sudo apt-get install sun-java6-plugin sun-java6-fonts 2. […]

  4. […] system I had both OpenJDK6 and Sun Java 6 loaded.  The recommendations that I read (including at this hyperlink) talked about how to remove Java 6 and install Java 7.  I did not really want to do that […]

  5. PatM says:

    Nice! Thanks for the writeup!

  6. Rajan says:

    I keep forgetting how to do this. Thanks a lot.

Leave a Reply

Your email address will not be published. Required fields are marked *