RE: Java in Linux

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Mark Phillips
Date:  
To: plug-discuss
Subject: RE: Java in Linux
Your error looks more serious than this suggestion, but did you set the
JAVA_HOME environment variable? What happens if you just type "java" at
the command line? I think you may have a corrupted rpm, or some missing
dependencies. Did you install the jsdk or the jre? In order to compile
and run your own java files you need the jsdk; the jre is not enough.

Since many rpm's are a version or more out of date, you may want to
remove the rpm and just download the jsdk from SUN. There is a Linux
version that you can install, both with and without a self installer.
There are also installation instructions (you just have to set the
JAVA_HOME environment variable). Basically, you can put the jsdk
anywhere on your system and you just have to set the JAVA_HOME to point
to the location of the jsdk. Oh, and you should put the JAVA_HOME/bin
directory in your PATH. This will allow you to type "javac" from the
command line.

If all your java files are in one directory, and that directory is in
your path (i.e. put "." in your path), and you run javac from that
directory, then you also do not have to worry about the classpath. For
more complicated projects (i.e. multiple packages), and if you are using
an IDE, you may not have to set a classpath either (see the instructions
for your particular IDE). For example, Netbeans (A great free IDE, BTW)
does not use the classpath but you must mount the jar files you need for
your project for java packages beyond the basic jsdk. In other words, it
creates the classpath for you based on the jars you have mounted.


Mark Phillips
Phillips Marketing, Inc.
602 524-0376 office
480 945-9197 fax



-----Original Message-----
From:
[mailto:plug-discuss-admin@lists.plug.phoenix.az.us] On Behalf Of steve
wiebelhaus
Sent: Sunday, April 04, 2004 5:43 PM
To:
Subject: Java in Linux

I am trying to install Java on my Linux box, Suse9.0 distro. I ran the
RPM
installer, followed the directins for linking it in the Suse distro.
When I
try to compile or execute any Java programs, I get errors

swiebel@slinux:~/Documents/hw5> javac Edge.java
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
swiebel@slinux:~/Documents/hw5> java MST
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
swiebel@slinux:~/Documents/hw5> java
Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/Object
swiebel@slinux:~/Documents/hw5>

Any ideas of what I forgot to setup?
I had a similar problem on WindowsXP which was related to setting the
"path"
and "class path" variables, is there a similar thing with Linux?

_________________________________________________________________
Persistent heartburn? Check out Digestive Health & Wellness for
information
and advice. http://gerd.msn.com/default.asp

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss