Categories
java

Did I install Java 5.0 or Not…

I recently installed Feora Core 3 on a desktop machine I have that decided it didn’t want to run Win XP anymore (can you blame it). Since I do most of my work/tinkering with Java on my Powerbook I hadn’t gotten around to installing Java on my newly built Fedora box. I have installed Java dozens of times. I feel like I could do it with my eyes closed, but…. I always read instructions and READMEs before installing anything.

So I did the same with the version of Java 5.0 I downloaded. There was nothing different/interesting in both the Sun provided instructions on their website or the README. So I went ahead and installed jdk1.5.0_02 on my machine. Then I fired off a simple “java -version” and expected some nice message saying I’m running java version… Is that what I got? Nope. I got the following confusing message:

[erikw@localhost local]$ gcc-java -version
libgcj-java-placeholder.sh

This script is a placeholder for the /usr/bin/java
master link required by jpackage.org conventions. libgcj’s
rmiregistry, rmic and jar tools are now slave symlinks to these
masters, and are managed by the alternatives(8) system.

This change was necessary because the rmiregistry, rmic and jar tools
installed by previous versions of libgcj conflicted with symlinks
installed by jpackage.org JVM packages.
gij (GNU libgcj) version 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)

Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

That was not what I expected to see. After a little bit of digging and hacking everything is fixed. This is what you need to do:
1. su – (i.e. become root)
2. [ -x /usr/bin/javac ] mv /usr/bin/javac /usr/bin/gcc-javac
3. [ -x /usr/bin/java ] mv /usr/bin/java /usr/bin/gcc-java

Then you should be able to fire off a java -version and get:
[erikw@localhost ~]$ java -version
java version “1.5.0_02”
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode, sharing)

2 replies on “Did I install Java 5.0 or Not…”

Is that supposed to be a new security feature or something? Obscure the version from non-root so that finding relevant exploits are harder/more time-consuming to find?

“It’s not a bug, It’s a FEATURE!”

Leave a Reply

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