| | |
jar running problem in linux build on windows
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
Hi friends,
I have build swing based application on windows os and I want to run this application in linux.
The .jar file runs perfectly on windows. but not running on linux.
gives error as below. pls. help
regent@regent:~/main the law$ java -jar thelaw.jar
Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: com.regent.thelaw.mainGUI.HomePageFrame
at ._ZN4java4lang11VMThrowable16fillInStackTraceEPNS0_9ThrowableE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang9Throwable16fillInStackTraceEv (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang9ThrowableC1EPNS0_6StringE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang5ErrorC1EPNS0_6StringE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang12LinkageErrorC1EPNS0_6StringE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang20NoClassDefFoundErrorC1EPNS0_6StringE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang13VMClassLoader18transformExceptionEPNS0_5ClassEPNS0_9ThrowableE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang13VMClassLoader12resolveClassEPNS0_5ClassE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang5Class15initializeClassEv (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang5Class7forNameEPNS0_6StringEbPNS0_11ClassLoaderE (/usr/lib/libgcj.so.6.0.0)
at ._ZN3gnu4java4lang10MainThread3runEv (/usr/lib/libgcj.so.6.0.0)
at ._Z13_Jv_ThreadRunPN4java4lang6ThreadE (/usr/lib/libgcj.so.6.0.0)
at ._Z11_Jv_RunMainP14_Jv_VMInitArgsPN4java4lang5ClassEPKciPS6_b (/usr/lib/libgcj.so.6.0.0)
at .main (/usr/lib/libgij.so.6.0.0)
at .__libc_start_main (/lib/tls/i686/cmov/libc-2.3.5.so)
Caused by: java.lang.ClassNotFoundException: java.lang.StringBuilder not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:thelaw.jar,file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at ._ZN4java4lang11VMThrowable16fillInStackTraceEPNS0_9ThrowableE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang9Throwable16fillInStackTraceEv (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang9ThrowableC1EPNS0_6StringE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang9ThrowableC1EPNS0_6StringEPS1_ (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang9ExceptionC1EPNS0_6StringEPNS0_9ThrowableE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang22ClassNotFoundExceptionC1EPNS0_6StringEPNS0_9ThrowableE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang22ClassNotFoundExceptionC1EPNS0_6StringE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java3net14URLClassLoader9findClassEPNS_4lang6StringE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang11ClassLoader9loadClassEPNS0_6StringEb (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang11ClassLoader9loadClassEPNS0_6StringE (/usr/lib/libgcj.so.6.0.0)
at ._Z13_Jv_FindClassP13_Jv_Utf8ConstPN4java4lang11ClassLoaderE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang5Class7forNameEPNS0_6StringEbPNS0_11ClassLoaderE (/usr/lib/libgcj.so.6.0.0)
at ._ZN20_Jv_BytecodeVerifier21verify_instructions_0Ev (/usr/lib/libgcj.so.6.0.0)
at ._Z16_Jv_VerifyMethodP16_Jv_InterpMethod (/usr/lib/libgcj.so.6.0.0)
at ._ZN21_Jv_InterpreterEngine9do_verifyEPN4java4lang5ClassE (/usr/lib/libgcj.so.6.0.0)
at ._ZN10_Jv_Linker12verify_classEPN4java4lang5ClassE (/usr/lib/libgcj.so.6.0.0)
at ._ZN10_Jv_Linker14wait_for_stateEPN4java4lang5ClassEi (/usr/lib/libgcj.so.6.0.0)
...8 more
I have build swing based application on windows os and I want to run this application in linux.
The .jar file runs perfectly on windows. but not running on linux.
gives error as below. pls. help
regent@regent:~/main the law$ java -jar thelaw.jar
Exception in thread "main" java.lang.NoClassDefFoundError: while resolving class: com.regent.thelaw.mainGUI.HomePageFrame
at ._ZN4java4lang11VMThrowable16fillInStackTraceEPNS0_9ThrowableE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang9Throwable16fillInStackTraceEv (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang9ThrowableC1EPNS0_6StringE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang5ErrorC1EPNS0_6StringE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang12LinkageErrorC1EPNS0_6StringE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang20NoClassDefFoundErrorC1EPNS0_6StringE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang13VMClassLoader18transformExceptionEPNS0_5ClassEPNS0_9ThrowableE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang13VMClassLoader12resolveClassEPNS0_5ClassE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang5Class15initializeClassEv (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang5Class7forNameEPNS0_6StringEbPNS0_11ClassLoaderE (/usr/lib/libgcj.so.6.0.0)
at ._ZN3gnu4java4lang10MainThread3runEv (/usr/lib/libgcj.so.6.0.0)
at ._Z13_Jv_ThreadRunPN4java4lang6ThreadE (/usr/lib/libgcj.so.6.0.0)
at ._Z11_Jv_RunMainP14_Jv_VMInitArgsPN4java4lang5ClassEPKciPS6_b (/usr/lib/libgcj.so.6.0.0)
at .main (/usr/lib/libgij.so.6.0.0)
at .__libc_start_main (/lib/tls/i686/cmov/libc-2.3.5.so)
Caused by: java.lang.ClassNotFoundException: java.lang.StringBuilder not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:thelaw.jar,file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
at ._ZN4java4lang11VMThrowable16fillInStackTraceEPNS0_9ThrowableE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang9Throwable16fillInStackTraceEv (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang9ThrowableC1EPNS0_6StringE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang9ThrowableC1EPNS0_6StringEPS1_ (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang9ExceptionC1EPNS0_6StringEPNS0_9ThrowableE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang22ClassNotFoundExceptionC1EPNS0_6StringEPNS0_9ThrowableE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang22ClassNotFoundExceptionC1EPNS0_6StringE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java3net14URLClassLoader9findClassEPNS_4lang6StringE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang11ClassLoader9loadClassEPNS0_6StringEb (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang11ClassLoader9loadClassEPNS0_6StringE (/usr/lib/libgcj.so.6.0.0)
at ._Z13_Jv_FindClassP13_Jv_Utf8ConstPN4java4lang11ClassLoaderE (/usr/lib/libgcj.so.6.0.0)
at ._ZN4java4lang5Class7forNameEPNS0_6StringEbPNS0_11ClassLoaderE (/usr/lib/libgcj.so.6.0.0)
at ._ZN20_Jv_BytecodeVerifier21verify_instructions_0Ev (/usr/lib/libgcj.so.6.0.0)
at ._Z16_Jv_VerifyMethodP16_Jv_InterpMethod (/usr/lib/libgcj.so.6.0.0)
at ._ZN21_Jv_InterpreterEngine9do_verifyEPN4java4lang5ClassE (/usr/lib/libgcj.so.6.0.0)
at ._ZN10_Jv_Linker12verify_classEPN4java4lang5ClassE (/usr/lib/libgcj.so.6.0.0)
at ._ZN10_Jv_Linker14wait_for_stateEPN4java4lang5ClassEi (/usr/lib/libgcj.so.6.0.0)
...8 more
This is happening cause you are using GCJ which does not support all classes mentioned in the official J2SE specifications.
Most probably on Windows you are using the JRE from Sun, I suggest you install the same on your Linux machine.
Most probably on Windows you are using the JRE from Sun, I suggest you install the same on your Linux machine.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
"How to ask questions the smart way ?"
"How to ask questions the smart way ?"
That's his worst problem, but not the immediate one.
The immediate one is failing to take into consideration the requirement to add the application classes to the classpath he uses to attempt to run it.
The immediate one is failing to take into consideration the requirement to add the application classes to the classpath he uses to attempt to run it.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Since you are running Ubuntu you can install the Sun JRE directly by issuing:
in your terminal.
But if you plan on doing some Java developement you should install the java SDK instead,
to do so just issue the following command in your terminal
But first I suggest you check whether all the required Jars/classes are included in your classpath as jwenting mentioned
Java Syntax (Toggle Plain Text)
apt-get install sun-java6-jre
But if you plan on doing some Java developement you should install the java SDK instead,
to do so just issue the following command in your terminal
Java Syntax (Toggle Plain Text)
apt-get install sun-java6-jdk
But first I suggest you check whether all the required Jars/classes are included in your classpath as jwenting mentioned
Last edited by stephen84s; Jun 23rd, 2008 at 4:16 am.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
"How to ask questions the smart way ?"
"How to ask questions the smart way ?"
thanks but when I give command
it gives me error like
so i give command
that gives me error
what should be the problem????
•
•
•
•
apt-get install sun-java6-jdk
•
•
•
•
root@regent:~/Desktop# apt-get install sun-java6-jdk
Reading package lists... Done
Building dependency tree... Done
W: Couldn't stat source package list http://archive.ubuntu.com breezy/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_breezy_universe_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://archive.ubuntu.com breezy/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_breezy_universe_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://archive.ubuntu.com breezy/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_breezy_universe_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://archive.ubuntu.com breezy/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_breezy_universe_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://archive.ubuntu.com breezy/multiverse Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_breezy_multiverse_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://archive.ubuntu.com breezy/multiverse Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_breezy_multiverse_binary-i386_Packages) - stat (2 No such file or directory)
W: You may want to run apt-get update to correct these problems
E: Couldn't find package sun-java6-jdk
so i give command
•
•
•
•
apt-get update
•
•
•
•
root@regent:~/Desktop# apt-get update
Ign cdrom://Ubuntu 5.10 _Breezy Badger_ - Release i386 (20051012) breezy Release.gpg
Ign http://archive.ubuntu.com breezy Release.gpg
Ign http://archive.ubuntu.com breezy Release
Ign http://archive.ubuntu.com breezy/universe Packages
Ign http://archive.ubuntu.com breezy/universe Packages
Ign http://archive.ubuntu.com breezy/universe Packages
Ign http://archive.ubuntu.com breezy/universe Packages
Ign http://archive.ubuntu.com breezy/multiverse Packages
Ign http://archive.ubuntu.com breezy/multiverse Packages
Err http://archive.ubuntu.com breezy/universe Packages
404 Not Found [IP: 91.189.88.31 80]
Err http://archive.ubuntu.com breezy/universe Packages
404 Not Found [IP: 91.189.88.31 80]
Err http://archive.ubuntu.com breezy/universe Packages
404 Not Found [IP: 91.189.88.31 80]
Err http://archive.ubuntu.com breezy/universe Packages
404 Not Found [IP: 91.189.88.31 80]
Err http://archive.ubuntu.com breezy/multiverse Packages
404 Not Found [IP: 91.189.88.31 80]
Err http://archive.ubuntu.com breezy/multiverse Packages
404 Not Found [IP: 91.189.88.31 80]
Failed to fetch http://archive.ubuntu.com/ubuntu/dis...86/Packages.gz 404 Not Found [IP: 91.189.88.31 80]
Failed to fetch http://archive.ubuntu.com/ubuntu/dis...86/Packages.gz 404 Not Found [IP: 91.189.88.31 80]
Failed to fetch http://archive.ubuntu.com/ubuntu/dis...86/Packages.gz 404 Not Found [IP: 91.189.88.31 80]
Failed to fetch http://archive.ubuntu.com/ubuntu/dis...86/Packages.gz 404 Not Found [IP: 91.189.88.31 80]
Failed to fetch http://archive.ubuntu.com/ubuntu/dis...86/Packages.gz 404 Not Found [IP: 91.189.88.31 80]
Failed to fetch http://archive.ubuntu.com/ubuntu/dis...86/Packages.gz 404 Not Found [IP: 91.189.88.31 80]
Reading package lists... Done
W: Couldn't stat source package list http://archive.ubuntu.com breezy/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_breezy_universe_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://archive.ubuntu.com breezy/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_breezy_universe_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://archive.ubuntu.com breezy/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_breezy_universe_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://archive.ubuntu.com breezy/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_breezy_universe_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://archive.ubuntu.com breezy/multiverse Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_breezy_multiverse_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://archive.ubuntu.com breezy/multiverse Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_breezy_multiverse_binary-i386_Packages) - stat (2 No such file or directory)
W: You may want to run apt-get update to correct these problems
E: Some index files failed to download, they have been ignored, or old ones used instead.
what should be the problem????
Thats cause your Ubuntu version is too old and the repositories are no longer supported, U will need to upgrade to a more recent version (@least 6.04) use for installing software via apt,
or do a manual install by downloading jdk from here
or do a manual install by downloading jdk from here
Last edited by stephen84s; Jun 23rd, 2008 at 5:59 am.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
"How to ask questions the smart way ?"
"How to ask questions the smart way ?"
is it possible to upgrade version using command
because it also gives me error....
most prob. same as apt-get update
it tells me to update the system..
•
•
•
•
apt-get upgrade
most prob. same as apt-get update
•
•
•
•
root@regent:~/Desktop# apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
W: Couldn't stat source package list http://archive.ubuntu.com breezy/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_breezy_universe_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://archive.ubuntu.com breezy/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_breezy_universe_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://archive.ubuntu.com breezy/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_breezy_universe_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://archive.ubuntu.com breezy/universe Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_breezy_universe_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://archive.ubuntu.com breezy/multiverse Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_breezy_multiverse_binary-i386_Packages) - stat (2 No such file or directory)
W: Couldn't stat source package list http://archive.ubuntu.com breezy/multiverse Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_breezy_multiverse_binary-i386_Packages) - stat (2 No such file or directory)
W: You may want to run apt-get update to correct these problems
it tells me to update the system..
K etan .rpm works only on Red Hat Based systems, Ubuntu is based on Debian so it uses to .deb versions.
For you currently it is no longer possible to upgrade to a newer version of Ubuntu by directly invoking
cause your version is too old.
In case you need to use MySQL also, I suggest you download the latest version from the Ubunu site
Cause otherwise u would need to manually compile and install all the software you need.
For you currently it is no longer possible to upgrade to a newer version of Ubuntu by directly invoking
Java Syntax (Toggle Plain Text)
apt-get upgrade
cause your version is too old.
In case you need to use MySQL also, I suggest you download the latest version from the Ubunu site
Cause otherwise u would need to manually compile and install all the software you need.
Last edited by stephen84s; Jun 23rd, 2008 at 7:08 am.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
"How to ask questions the smart way ?"
"How to ask questions the smart way ?"
![]() |
Other Threads in the Java Forum
- Previous Thread: painting images on a Jpanel already running???
- Next Thread: StringBuffer and PrintStream
| Thread Tools | Search this Thread |
3d @param affinetransform android api applet application arc arguments array arrays automation binary bluetooth byte capture chat class classes click client code color compare component count database design detection eclipse eclipsedevelopment encryption error event exception fractal game givemetehcodez graphics gridlayout gui guitesting helpwithhomework html ide if_statement image input integer interface j2me java java.xls javaprojects jni jpanel julia keytool keyword linux list loop macintosh map method methods mobile netbeans newbie object os pong print problem producer program programming project projectideas read recursion replaysolutions rim scanner screen server set size sms sort sql string swing terminal threads transforms tree ui web windows






