jar running problem in linux build on windows

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: May 2008
Posts: 20
Reputation: regent_royal has a little shameless behaviour in the past 
Solved Threads: 0
regent_royal's Avatar
regent_royal regent_royal is offline Offline
Newbie Poster

jar running problem in linux build on windows

 
0
  #1
Jun 21st, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 1,175
Reputation: stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light 
Solved Threads: 125
Featured Poster
stephen84s's Avatar
stephen84s stephen84s is offline Offline
Veteran Poster

Re: jar running problem in linux build on windows

 
0
  #2
Jun 21st, 2008
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.
"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 ?"
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: jar running problem in linux build on windows

 
0
  #3
Jun 21st, 2008
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.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 1,175
Reputation: stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light 
Solved Threads: 125
Featured Poster
stephen84s's Avatar
stephen84s stephen84s is offline Offline
Veteran Poster

Re: jar running problem in linux build on windows

 
0
  #4
Jun 23rd, 2008
Since you are running Ubuntu you can install the Sun JRE directly by issuing:

  1. apt-get install sun-java6-jre
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

  1. 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 ?"
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 20
Reputation: regent_royal has a little shameless behaviour in the past 
Solved Threads: 0
regent_royal's Avatar
regent_royal regent_royal is offline Offline
Newbie Poster

Re: jar running problem in linux build on windows

 
0
  #5
Jun 23rd, 2008
thanks but when I give command
apt-get install sun-java6-jdk
it gives me error like

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
that gives me error

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????
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 1,175
Reputation: stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light 
Solved Threads: 125
Featured Poster
stephen84s's Avatar
stephen84s stephen84s is offline Offline
Veteran Poster

Re: jar running problem in linux build on windows

 
0
  #6
Jun 23rd, 2008
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
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 ?"
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 20
Reputation: regent_royal has a little shameless behaviour in the past 
Solved Threads: 0
regent_royal's Avatar
regent_royal regent_royal is offline Offline
Newbie Poster

Re: jar running problem in linux build on windows

 
0
  #7
Jun 23rd, 2008
is it possible to upgrade version using command


apt-get upgrade
because it also gives me error....
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
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 20
Reputation: regent_royal has a little shameless behaviour in the past 
Solved Threads: 0
regent_royal's Avatar
regent_royal regent_royal is offline Offline
Newbie Poster

Re: jar running problem in linux build on windows

 
0
  #8
Jun 23rd, 2008
and before that I tried for mannual installation but. It also gives me so much error...

I know there are total 3 types of installation
.deb
.rpm
.tar.gz

also try all but not succedd..

I tried for all three but not succedd cause I also want install MySql. and Jdk as u know.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 1,175
Reputation: stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light stephen84s is a glorious beacon of light 
Solved Threads: 125
Featured Poster
stephen84s's Avatar
stephen84s stephen84s is offline Offline
Veteran Poster

Re: jar running problem in linux build on windows

 
0
  #9
Jun 23rd, 2008
.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

  1. 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 ?"
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 20
Reputation: regent_royal has a little shameless behaviour in the past 
Solved Threads: 0
regent_royal's Avatar
regent_royal regent_royal is offline Offline
Newbie Poster

Re: jar running problem in linux build on windows

 
0
  #10
Jun 23rd, 2008
currently to upgrade my breezy version to dapper i am doing this steps...

edit the file /etc/apt/sources.list (as root)
replace all instances of "breezy" with "dapper"

run the command
"sudo apt-get update && sudo apt-get dist-upgrade"

can I work after it...?????
K etan
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the Java Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC