Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-20-2009, 08:13 AM   #1
LQ Newbie
Registered: Apr 2009
Posts: 16

Rep: Reputation: 0
[Java] Installing Java on Debian Linux

Hi all,
I want to install Sun JDK on my Debian Linux system and installed it in /opt by downloading the appropriate .bin file and running it. I also added the path of my Java installation to the PATH variable. But still, when I use 'java' command, gcj is being used.

I did a 'which java' and it showed /usr/bin/java which was a symbolic link to /etc/alternatives/java. How can I make Sun JDK the default without disturbing gcj or removing or modifying the symbolic link?

Thanks in advance.
Old 06-20-2009, 09:12 AM   #2
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
As root, update-alternatives --config java
Old 06-20-2009, 09:45 AM   #3
Senior Member
Registered: Mar 2004
Location: far enough
Distribution: OS X 10.6.7
Posts: 1,690

Rep: Reputation: 52
@lgp171188, you could also install sun jdk or openjdk using apt-get, and remove entirely gcj/gij packages later. You don't need to have gcj/gij installed, at all. As @AlucardZero suggested, you can also use pdate-alternatives. The easiest installation/configuration is probably apt-get in your case.
Old 06-20-2009, 11:40 AM   #4
Senior Member
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,829
Blog Entries: 27

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Why download it from Sun? USe the package managment system that Debian has. Pretty much anything you could ever need is in the repos.

sun-jav6-jdk is in the non-free repos unless your on etch in which case it is in apt-get install sun-java6-kdk then As root, update-alternatives --config java


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing Java on Debian Majiy Debian 3 02-27-2009 04:11 AM
Installing Java on Debian ... Mini Howto rickh Debian 17 01-18-2008 10:31 PM
need help installing java for mozilla 1.7.8 in debian skwerel Linux - Newbie 2 05-01-2006 11:26 PM
problem with installing java on debian nédée Linux - Software 7 12-16-2005 11:18 PM
installing Java on Firefox with Debian (I know, I've searched...) Panthroman Linux - Newbie 3 03-02-2005 01:13 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:13 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration