Ubuntu default Java Runtime
- Published September 30th, 2005 in Tips & Tricks, Ubuntu
Attention: Ubuntu uses gcj and gci as the default java runtime environment. Result: half of the things you try to run in java are broken.
To install Sun’s Java SDK just add this to your /etc/apt/sources.list
deb http://ubuntu.tower-net.de/ubuntu/ hoary java
deb http://archive.ubuntu.com/ubuntu/ hoary multiverse
And then update your symbolic links of all the java binaries under /etc/alternatives. This is done by doing update-alternatives java as root. Breezy automatically updates this but you’d better run it if you’re using Hoary or prior versions of Ubuntu. Done.




Please run ‘man update-alternatives’ and then as root ‘update-alternatives java’. Maybe then you’ll not fuck up your system.
Well, manually changing the symbolic links worked fine, but thank you for your suggestion, it is the way politically correct of doing things :-) Same applies to update-rc.d (instead of manually linking init.d scripts to rcX.d).
hmmm, that’s all well and good, but i’m not sure what symbolic links are, can someone point me in the right direction, i just got j2re installed.
tool462,
Forget that, just do
update-alternatives javaas root after installing j2re.I got the J2ee installed but when I execute sudo update-alternatives –config java I only see this :
douglas@PortableDouglas:~$ update-alternatives –config java
There are 2 alternatives which provide `java’.
Selection Alternative
———————————————–
* 1 /usr/bin/gij-wrapper-4.0
+ 2 /usr/lib/jvm/java-gcj/bin/java
Press enter to keep the default[*], or type selection number:
douglas@PortableDouglas:~$
nothing about the jre I installed with j2ee
try
apt-get install sun-java6-bin