LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux > 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
 
Thread Tools Search this Thread
Old 12-20-2007, 06:40 AM   #1
immortaltechnique
Member
 
Registered: Oct 2006
Location: Kenya
Distribution: Debian Etch, FreeBSD,FC9
Posts: 280
Thanked: 1
.Jar file execution error on FC7


[Log in to get rid of this advertisement]
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
immortaltechnique is offline     Reply With Quote
Old 12-20-2007, 06:53 AM   #2
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,294
Thanked: 13
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.
reddazz is offline     Reply With Quote
Old 12-21-2007, 01:09 AM   #3
immortaltechnique
Member
 
Registered: Oct 2006
Location: Kenya
Distribution: Debian Etch, FreeBSD,FC9
Posts: 280
Thanked: 1

Original Poster
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.
immortaltechnique is offline     Reply With Quote
Old 12-21-2007, 01:45 AM   #4
reddazz
Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,294
Thanked: 13
If its exactly the same error, then its still the issue about gcj. Did you run the alternatives command to switch the default java?
reddazz is offline     Reply With Quote
Old 12-21-2007, 01:51 AM   #5
jay73
Senior Member
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 8.04 / 9.04
Posts: 4,791
Thanked: 91
NoClassDefErrors typically arise when the binary can't be found by the JVM. Did you get the path right?
jay73 is offline     Reply With Quote
Old 12-21-2007, 02:16 AM   #6
immortaltechnique
Member
 
Registered: Oct 2006
Location: Kenya
Distribution: Debian Etch, FreeBSD,FC9
Posts: 280
Thanked: 1

Original Poster
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.
immortaltechnique is offline     Reply With Quote
Old 12-21-2007, 05:26 AM   #7
jay73
Senior Member
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 8.04 / 9.04
Posts: 4,791
Thanked: 91
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 05:30 AM..
jay73 is offline     Reply With Quote

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 06:46 AM
Invalid swap file error upgrading from FC6 to FC7 f1f1 Fedora 6 07-10-2007 09:03 PM
Java apps runs fine but gives error from jar file-NoClassDefFoundError lbyrd Linux - Software 5 04-25-2006 12:50 PM
Fedora Core 1 Associating .jar files with java -jar command pymehta Fedora 0 01-13-2005 06:26 AM
Help installing a (.jar) file. troycus Linux - Newbie 6 10-08-2003 08:23 PM


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

Main Menu
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.
Advertisement
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Click Here to receive a complimentary subscription courtesy of LQ.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration