I just got fedora a month ago. I ran the jre installation package for linux, and it said "software was succesfully installed". However - if I go to the files created by the rpm, and go into the bin directory and run java -version, I get a class not found : Object error.
I know that there are other posts regarding this topic - but my question is high level. Why is java 2 so complicated on Fedora ? I used to have java 1.3 installed in my HOME path, but to run java 1.4 I simply downloaded the SDK, and explicitly specified the path to it in my java commands i.e. i could use any version of java by simply specifying the path to the JVM explicitly (i.e. typing something like j14sdk/bin/java -version).
This is so weird ? What did java 2 change that doesnt allow you to run it from a local location on linux ?
Originally posted by jay vas:
Why is java 2 so complicated on Fedora ?
Some Linux distributions pride themselves on not using commercial, closed-source code. If you don't like that "feature" of Fedora, perhaps you should find a distribution that is more tightly integrated with Java.
There's a certain road and it's paved with Good Intentions. Personally, I find "alternatives" confusing, and I've RTFM'd in detail. Java is very easy to run multiple editions on most OSs (including Linux). Not only per-user, but per-app. Simply setting a JAVA_HOME is enough for many popular apps like Eclipse, WebLogic, Tomcat, etc. Roll-your-own apps can follow that lead (you're actually running $JAVA_HOME/bin/java) in their own execution scripts.
Because Fedora wishes to be "politically correct", the java that comes with Fedora is gcj, which isn't a very complete or powerful implementation. What can make things even worse is not getting the JAVA_HOME/CLASSPATH/PATH settings in sync. You can end up running gcj, but pulling the Sun JVM's classes or similar mischances. Which won't work.
In all cases, if the class java.lang.Object can't be found, you have a basic classpath issue, since jlO is in the jvm lib core.
Why is Java 1.5 any different ?
That sounds like a question for the Fedora contributor mailing list.
I can't speak to installing Java locally. Never tried it. However, I've used two Linux distributions with JDK 1.5: Gentoo and Ubuntu, and both of them had very straightforward install procedures. I use OpenSUSE at work. Compare the OpenSUSE procedure with Fedora's. Much simpler. I just took 10 minutes and now I've got JDK 1.5 in OpenSuse.
Remember that Fedora is a bleeding-edge distribution. It is ment for community testing, not for stability or ease-of-use. If you don't like it, switch. That's part of the "free" in Free Software.
"Setting JDK 5.0 to be the default - On Solaris 8 and 9, it is possible for root users to make JDK 5.0 the default Java platform by modifying the /usr/java symbolic link to point to /usr/jdk/jdk1.5.0. On Solaris 9, a root user would modify the /usr/j2se symbolic link to point to the same 5.0 directory..."
I used the self-extracting binary (*.bin) and not the *.rpm version (I am running v1.5.0 update 7) because this can be customized to install in a folder you choose. I installed into /opt and used the instruction above to repoint all the sym links of the JDK tools under /usr/bin to that installation (of course I backed up all the old ones there first).
The Solaris install guide can be found here: http://java.sun.com/j2se/1.5.0/install-solaris.html
After that I got it all running smoothly, but of course the dampener is that you have to know the Solaris install guide beforehand for a workaround.
[ December 01, 2006: Message edited by: Val Pecaoco ]