Hi, i'm trying for my first time to use some java-based software, but
i can't
get any JAR files to execute. I tried the following command-lines:
gij -jar FILENAME
java -jar FILENAME
and i only get error messages like those listed at the end of this
message.
I copied a "hello world" example from a Java book, and the compiled
CLASS
file executes perfectly. I don't know how to create a JAR file by
myself, so i
can't test if a self-created JAR file executes or not.
All java-related environment variables i know are empty:
CLASSPATH
JAVA_HOME
I tried to figure out several settings for these variables, without
success.
I suspect that i just have to configure these variables, but i don't
know how
to do that.
I would appreciate any help.
Jerzy
My system (no other problems with FC3):
Fedora Core 3 (freshly installed, all packages from the FC3 CDs
only.)
HP Pavilion ze4300 notebook
Pentium 4
256 MB RAM
Java-related packages i could find on my system:
gcc-java-3.4.2-6.fc3
jpackage-utils-1.5.38-1jpp_3rh
libgcj-3.4.2-6.fc3
libgcj-devel-3.4.2-6.fc3
Error messages when i try to run Multivalent20040415.jar:
(Similar output for other software from several sources.)
Exception in thread "main" java.lang.NoClassDefFoundError: while
resolving class: multivalent.Multivalent
at java.lang.VMClassLoader.resolveClass(java.lang.Class)
(/usr/lib/libgcj.so.5.0.0)
at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.5.0.0)
at java.lang.Class.forName(java.lang.String, boolean,
java.lang.ClassLoader) (/usr/lib/libgcj.so.5.0.0)
at java.lang.Class.forName(java.lang.String)
(/usr/lib/libgcj.so.5.0.0)
at gnu.gcj.runtime.FirstThread.run() (/usr/lib/libgcj.so.5.0.0)
at _Jv_ThreadRun(java.lang.Thread) (/usr/lib/libgcj.so.5.0.0)
at _Jv_RunMain(java.lang.Class, byte const, int, byte const,
boolean) (/usr/lib/libgcj.so.5.0.0)
at __libc_start_main (/lib/tls/libc-2.3.3.so)
Caused by: java.lang.ClassNotFoundException: javax.imageio.ImageIO not
found in [file:Multivalent20040415.jar, core:/]
at java.net.URLClassLoader.findClass(java.lang.String)
(/usr/lib/libgcj.so.5.0.0)
at gnu.gcj.runtime.VMClassLoader.findClass(java.lang.String)
(/usr/lib/libgcj.so.5.0.0)
at java.lang.ClassLoader.loadClass(java.lang.String, boolean)
(/usr/lib/libgcj.so.5.0.0)
at _Jv_FindClass(_Jv_Utf8Const, java.lang.ClassLoader)
(/usr/lib/libgcj.so.5.0.0)
at _Jv_PrepareCompiledClass(java.lang.Class)
(/usr/lib/libgcj.so.5.0.0)
at _Jv_WaitForState(java.lang.Class, int)
(/usr/lib/libgcj.so.5.0.0)
at java.lang.VMClassLoader.linkClass0(java.lang.Class)
(/usr/lib/libgcj.so.5.0.0)
at java.lang.VMClassLoader.resolveClass(java.lang.Class)
(/usr/lib/libgcj.so.5.0.0)
...7 more
richard.anderson970@gmail.com - 07 Apr 2005 22:20 GMT
Well, the error you're getting is probably because the CLASSPATH
variable is empty. To start, why don't you set it with the following
command:
export CLASSPATH=.:<JAR FILE THAT CONTAINS Multivalent GOES HERE>
example: export CLASSPATH=.:multivalent.jar
You might want to put it in your .bashrc, so that it gets loaded
everytime your system starts.
You also might consider downloading a JDK from Sun, since it looks like
you don't have one on your system.
Jerzy Jalocha - 15 Apr 2005 17:17 GMT
Richard, thank you for yor answer!
> Well, the error you're getting is probably because the CLASSPATH
> variable is empty. To start, why don't you set it with the following
> command:
> export CLASSPATH=.:<JAR FILE THAT CONTAINS Multivalent GOES HERE>
[...]
> You also might consider downloading a JDK from Sun, since it looks like
> you don't have one on your system.
I installed the JDK and tried with the CLASSPATH, too, but without
success. I´m reading a Java tutorial now, see if this helps. But i´m
wondering if it´s normal for the JAVA_HOME variable to be emtpy?
I guess i´m missing just a very basic point, because i´m unable to run
ANY jar file i tried so far, and that´s been quite a lot so far
(including many packages for XML from Apache).
Sorry for the long delay in my answer. It´s just because im´s living
actually in a small house far away from the civilization (and the
internet), and i come donwn to the village only from time to time.
Best regards,
Jerzy
Jerzy Jalocha - 20 Apr 2005 21:48 GMT
Hello, I´m back again.
Fortunately, after installing the sun SDK, the problem
was solved just setting the three environment variables:
export CLASSPATH=.:[whaterver jar file]
export Java_HOME=/usr/home/jdk1.5.0/
export PATH=$JAVA_HOME/bin:$PATH
Thanks for your help!
Jubril OyeSiji - 15 Apr 2005 02:01 GMT
You need to install a JDK
> Hi, i'm trying for my first time to use some java-based software, but
> i can't
[quoted text clipped - 73 lines]
> (/usr/lib/libgcj.so.5.0.0)
> ...7 more