Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / April 2005

Tip: Looking for answers? Try searching our database.

FC3: Java refuses to run JAR

Thread view: 
Jerzy Jalocha - 07 Apr 2005 22:11 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.