Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-18-2010, 08:52 PM   #1
LQ Newbie
Registered: Mar 2010
Posts: 2

Rep: Reputation: 0
Unhappy GCJ (g@y copy of jdk)

Hello everyone,

i am running a debian etch with tomcat5.5.

Unfortunatly, debian's installation of tomcat forces gcj as java vm.

And I'm so sick of gcj,
it may work nice to do a System.out.println("Hello World") but that's about all it can do right!

Don't get me wrong...
I totally agree with open-source's philosophy...
but the legal aspect put aside, i cant figure out any reason to use such a useless tool as gcj. It never work as expected and cannot meet professional expectations.

So I downloaded the jdk from SUN
but it seems setting JAVA_HOME in ~/.bashrc or /etc/profile doesnt affect path and so i cannot set jvm right (it keeps choosing gcj, which is bad).

Can i safely remove those links (java/javac) in /usr/bin and replaced them with my own link to SUN's jdk?
Since i have tomcat installed, i cannot remove gcj without breaking dependancies.. synaptic suggest removing tomcat as well..
and i need tomcat for/at work, and i prefer wasting weeks and months to install SUN's jdk or working with tomcat on windows xp than using the already installed gcj.

Thanks in advance
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-18-2010, 09:55 PM   #2
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,822

Rep: Reputation: 610Reputation: 610Reputation: 610Reputation: 610Reputation: 610Reputation: 610
install sun-java5-jre

then (as root) update-alternatives --config java
2 members found this post helpful.
Old 03-19-2010, 04:31 AM   #3
LQ Newbie
Registered: Mar 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Originally Posted by AlucardZero View Post
install sun-java5-jre

then (as root) update-alternatives --config java
Thanx for the quick reply,
update-alternatives --config java was the command i was looking for.
I thought the command was something like 'java-config' lol (it's probably only a tool existing on Gentoo)

I'd rather not using jre5 because it is only a renamed jre1.4.2 plus minor changes.
I downloaded the jdk bin on oracle's website and installed it in /opt/jdk1.6.0_18/

I added to the /etc/profile:
export JAVA_HOME=/opt/jdk1.6.0_18
export PATH=$PATH:$JAVA_HOME/bin

But nothing is installed in the /etc/alternatives so update-alternatives cannot find anything else than gcj in the 'java group'.

So i read a little about update-alternatives and in the debian FAQ, i found how to add my jdk to the 'java group':

# update-alternatives --install /usr/bin/java java /opt/jdk1.6.0_18/bin/java 90

# update-alternatives --install /usr/bin/javac javac /opt/jdk1.6.0_18/bin/javac 90

As said in the FAQ:
The first argument to `--install' option is the symlink that points to /etc/alternatives/NAME, where NAME is the second argument. The third argument is the program to which /etc/alternatives/NAME should point to, and the fourth argument is the priority (larger value means the alternative will more probably get picked automatically).

The result is:
# update-alternatives --config java
Il y a 2 alternatives fournissant ¬ę¬*java¬*¬Ľ.

Sélection Alternative
1 /usr/bin/gij-wrapper-4.1
*+ 2 /opt/jdk1.6.0_18/bin/java

Appuyez sur Entr√©e pour conserver la valeur par d√©faut[*] ou choisissez le num√©ro s√©lectionn√©¬*:2
Utilisation de ¬ę¬*/opt/jdk1.6.0_18/bin/java¬*¬Ľ pour fournir ¬ę¬*java¬*¬Ľ.
# java -version
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)

Thanx again

Last edited by lagrenouille; 03-19-2010 at 04:34 AM.
Old 03-19-2010, 07:23 AM   #4
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,822

Rep: Reputation: 610Reputation: 610Reputation: 610Reputation: 610Reputation: 610Reputation: 610
Oh, well, the reason I told you to install sun-java5-jre is because it's in Etch and sun-java6-jre isn't, and so you wouldn't have to go through the manual alternatives process.
1 members found this post helpful.


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
Where to get JDK 1.5.0_08 and JDK 1.6.0_10 for Linux Redhat Itanium servers java_ascii Linux - Software 1 09-22-2009 11:17 AM
Importance of GCJ vs. JDK piggysmile Programming 2 04-12-2006 11:27 AM
gcj javac instead of jdk javac rvindiola Linux - Newbie 2 03-29-2006 08:18 PM
Eclipse and gcj as JDK foucault Linux - Software 0 10-23-2005 11:56 AM
need help with gcj max_rsr Programming 1 05-24-2005 03:07 AM

All times are GMT -5. The time now is 01:31 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration