Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

java -jar a.jar para1 in linux

Status
Not open for further replies.

neltan

Programmer
Nov 4, 2002
82
AU
Hi All,

I can run the jar in window. But it fail in linux...
Is there anybody can help me ??


[root@hr bin]# java -jar Roster.jar init.conf
Warning: -jar not understood. Ignoring.
Exception in thread "main" java.lang.NoClassDefFoundError: Roster.jar
at 0x40268e17: java.lang.Throwable.Throwable(java.lang.String) (/usr/lib/./libgcj.so.3)
at 0x4025bc8e: java.lang.Error.Error(java.lang.String) (/usr/lib/./libgcj.so.3)
at 0x4025d6b6: java.lang.LinkageError.LinkageError(java.lang.String) (/usr/lib/./libgcj.so.3)
at 0x4025eb36: java.lang.NoClassDefFoundError.NoClassDefFoundError(java.lang.String) (/usr/lib/./libgcj.so.3)
at 0x402ad075: gnu.gcj.runtime.FirstThread.run() (/usr/lib/./libgcj.so.3)
at 0x4024fc4c: _Jv_ThreadRun(java.lang.Thread) (/usr/lib/./libgcj.so.3)
at 0x4021c8ac: _Jv_RunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/./libgcj.so.3)
at 0x08048910: ?? (??:0)
at 0x42015574: __libc_start_main (/lib/tls/libc.so.6)
at 0x080486c1: ?? (??:0)
 
Can you post the results of ...

java -version

... it looks like your command should work, but it might depend on what version of java your are running
 
[root@hr bin]# java -version
java version "1.3.1"
jdkgcj 0.2.3 (gcj (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
I have 1.4.2, why java version is 1.3.1 ??

/usr/local/j2sdk1.4.2/bin
 
Some versions of Linux come with a GNU JVM. If you type in a console "which java", it will show you the path. You have two options, either go to this directory and delete the "java", "javac" etc commands, or make sure your reference to these command (/usr/local/j2sdk1.4.2/bin) is set in the PATH environment variable before the GNU ones are.
 
set the classpath to your jar. The classpath should include the name of the jar.

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top