LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-29-2003, 10:35 PM   #1
matt_w_lambert
Member
 
Registered: Jan 2003
Location: WA
Distribution: Red Hat 9.0, mandrake 9.2
Posts: 194

Rep: Reputation: 30
help runing a java program


i installed java and tryed to run a program and i get

java.lang.NoClassDefFoundError

i didn't know if it was the program or if i didn't set somthing up right
 
Old 10-29-2003, 11:11 PM   #2
moeminhtun
Member
 
Registered: Dec 2002
Location: Singapore
Distribution: Fedora Core 6
Posts: 647

Rep: Reputation: 30
The error means
your JVM can't find your java program. Make sure you open the terminal in the same directory as your java class file.

(Alternatively you can give the classpath to it but don't think about it first. Try the first one first)
 
Old 10-29-2003, 11:25 PM   #3
matt_w_lambert
Member
 
Registered: Jan 2003
Location: WA
Distribution: Red Hat 9.0, mandrake 9.2
Posts: 194

Original Poster
Rep: Reputation: 30
ok i did what you said and i get the error

#java jitac-0.2.0.jar

Exception in thread "main" java.lang.NoClassDefFoundError: jitac-0.2.0.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 0x406978c7: __libc_start_main (/lib/libc.so.6)
at 0x080486c1: ?? (??:0)
 
Old 10-29-2003, 11:35 PM   #4
moeminhtun
Member
 
Registered: Dec 2002
Location: Singapore
Distribution: Fedora Core 6
Posts: 647

Rep: Reputation: 30
you cannot run ".jar" files like that.

You have to do this for jar files.

java -jar jitac-0.2.0.jar
 
Old 10-31-2003, 10:42 AM   #5
german
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian etch, Gentoo
Posts: 312

Rep: Reputation: 30
or:

java -cp jitac-0.2.0.jar [classname in jar, like com.bunk.foo.FooBar]
 
  


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
Please help with my Java program filsed Programming 1 05-02-2005 03:58 AM
Runing a program on startup extremebfn Linux - General 3 01-15-2005 04:57 AM
Stop java program(threaded program..should end cleanly) rmanocha Programming 4 11-09-2004 09:36 AM
Java Program merlin371 Linux - Software 11 01-18-2004 04:09 PM
Runing the C program in Linux vbp1 Programming 1 05-31-2001 03:27 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:52 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