LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-20-2007, 05:40 AM   #1
immortaltechnique
Member
 
Registered: Oct 2006
Location: Kenya
Distribution: Ubuntu, RHEL, OpenBSD
Posts: 287

Rep: Reputation: 32
.Jar file execution error on FC7


Hallo all,

Am having abit of a problem executin a client sided of a Cafe software:

when i run the server side of the software using ./Cafepilot_Server.jar, it executes perfectly.

now when i try to do the same for the client side i get the following error:
Code:
invalid file (bad magic number): Exec format error
So i figured out i could use java -jar Cafepilot_client.jar, but that annoingly throws up the following errors:
Code:
Exception in thread "main" java.lang.NoClassDefFoundError: sun.misc.BASE64Decoder
   at com.dijitanix.cafepilot.cafepilotclient.gb.b(gb.java)
   at com.dijitanix.cafepilot.cafepilotclient.Main.main(Main.java)
I also try java cafepilot_Client.jar and i get even more errors:

Code:
Exception in thread "main" java.lang.NoClassDefFoundError: CafePilot_Client.jar
   at gnu.java.lang.MainThread.run(libgcj.so.8rh)
Caused by: java.lang.ClassNotFoundException: CafePilot_Client.jar not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.8rh)
   at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.8rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.8rh)
   at java.lang.ClassLoader.loadClass(libgcj.so.8rh)
   at gnu.java.lang.MainThread.run(libgcj.so.8rh)
what might the issue be. Am running on FC7
 
Old 12-20-2007, 05:53 AM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
It could be that you are usng gcj which ships with Fedora by default. I would suggest you try Sun java and this article will help you with that.
 
Old 12-21-2007, 12:09 AM   #3
immortaltechnique
Member
 
Registered: Oct 2006
Location: Kenya
Distribution: Ubuntu, RHEL, OpenBSD
Posts: 287

Original Poster
Rep: Reputation: 32
Thanks alot redazz for you response. I installed Sun Jdk but i still get the same error.

Any more ideas? I simply cant understand why the server is working perfectly yet the client is generating all these error.
 
Old 12-21-2007, 12:45 AM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
If its exactly the same error, then its still the issue about gcj. Did you run the alternatives command to switch the default java?
 
Old 12-21-2007, 12:51 AM   #5
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
NoClassDefErrors typically arise when the binary can't be found by the JVM. Did you get the path right?
 
Old 12-21-2007, 01:16 AM   #6
immortaltechnique
Member
 
Registered: Oct 2006
Location: Kenya
Distribution: Ubuntu, RHEL, OpenBSD
Posts: 287

Original Poster
Rep: Reputation: 32
Yes i ran the alternative commands but it dint work unless i missed one. Kindly forward me any alternatives.

As for the Paths how do i define the paths? Is this done during executing time or when is it done.

And is there a way to fix the gjc error?


Thanks alot for taking the time to help.
 
Old 12-21-2007, 04:26 AM   #7
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
If you want to install the sun jdk on Fedora without too many issues, you should use jpackage.org to install the java-compat package, then install the jdk. There are some conflicts between Fedora and jpackage, though, so you need to be careful if you use if for other java packages too. Having the compat package makes running alternatives a lot more straightforward. It essentially creates all the links that a pre-installed environment like gcj already has.

You can also install galternatives, which is an alternatives GUI. Again more straightforward, you just need to check the proper items.

As for the path, that could mean various things. First of all, you need to make sure that you are in the right directory before you execute java -jar. It is also possible that the jar file needs to be appended to your classpath in /etc/profile or your .bash_profile, something like this:

Quote:
export JMF_HOME=/opt/jmf/JMF-2.1.1e
export JAVA_HOME=/usr/java/jdk1.6.0_03
export J2RE_HOME=/usr/java/jdk1.6.0_03/jre
export JAVAMP3_HOME=/opt/javamp3-1_0
#export JAVA_HOME=/opt/jdk1.6.0_03
#export J2RE_HOME=/opt/jdk1.6.0_03/jre
export JAI_HOME=/opt/jai
export JAI_IMAGEIO_HOME=/opt/jai_imageio-1_1
export JOGL_HOME=/opt/jogl
export JAVA_BIN=$JAVA_HOME/bin
export JDIC_HOME=/opt/jdic
export CLASSPATH=$JMF_HOME/lib/jmf.jar:$JMF_HOME/lib/fobs4jmf.jar:$JMF_HOME/lib/sound.jar:$JAVAMP3_HOME/lib/mp3plugin.jar:/opt/MPEG4VideoDecoderEval.zip:.:$JAVA_HOME:$JAVA_HOME/lib:
$JAI_HOME/lib/ext/jai_codec.jar:$JAI_HOME/lib/ext/jai_core.jar:$JAI_HOME/lib/ext/mlibwrapper_jai.jar:$JAI_IMAGEIO_HOME/lib/jai_imageio.jar:$JAI_IMAGEIO_HOME/lib/clibwrapper_jiio.jar:$JOGL_HOME/lib/jogl.jar:$JOGL_HOME/lib/gluegen-rt.jar:$JDIC_HOME/jdic.jar
export PATH=$JAVA_BIN:$PATH:$HOME/bin


LD_LIBRARY_PATH=$JMF_HOME/lib:$JAI_HOME/lib/i386:$JAI_IMAGEIO_HOME/lib:$JOGL_HOME/lib:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
This one has many more items than you need but I guess you can get the idea.

Last edited by jay73; 12-21-2007 at 04:30 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I must install a .jar file and I don't know how to do it :| zovres Linux - Newbie 6 10-28-2008 05:46 AM
Invalid swap file error upgrading from FC6 to FC7 f1f1 Fedora 6 07-10-2007 08:03 PM
Java apps runs fine but gives error from jar file-NoClassDefFoundError lbyrd Linux - Software 5 04-25-2006 11:50 AM
Fedora Core 1 Associating .jar files with java -jar command pymehta Fedora 0 01-13-2005 05:26 AM
Help installing a (.jar) file. troycus Linux - Newbie 6 10-08-2003 07:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration