LinuxQuestions.org
Help answer threads with 0 replies.
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 04-27-2004, 10:14 AM   #1
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Rep: Reputation: 31
Exception in thread "main" java.lang.NoClassDefFoundError:


I have problem with java. Here's the detail:

$ ls /usr/local/j2sdk1.4.2_03/
COPYRIGHT README bin jre src.zip
LICENSE README.html demo lib
LimeWireLinux.bin THIRDPARTYLICENSEREADME.txt include man

$ echo $PATH
/usr/local/OpenOffice:/usr/local/j2sdk1.4.2_03/bin:/home/knight/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/kde/bin:/usr/lib/qt-3.2.2/bin:/usr/share/texmf/bin:.

$ echo $JAVA_HOME
/usr/local/j2sdk1.4.2_03

$ echo $CLASSPATH
/home/knight/work/java

$ pwd
/home/knight/work/java

$ ls
HelloWorldApp.java

$ vim HelloWorldApp.java

Code:
/**
 * The HelloWorldApp class implements an application that
 * simply displays "Hello World!" to the standard output.
 */
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); // Display "Hello World!"
    }
}
$ javac HelloWorldApp.java
$

$ java HelloWorldApp.class
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorldApp/class

Any idea???????

Help. I want to learn java programming.
 
Old 04-27-2004, 11:10 AM   #2
devit
Member
 
Registered: Jan 2004
Distribution: Slackware 9.1
Posts: 82

Rep: Reputation: 15
Try:
Code:
$ java HelloWorldApp
This should work.
 
Old 04-27-2004, 11:49 AM   #3
melinda_sayang
Member
 
Registered: Dec 2003
Location: Petaling Jaya
Distribution: Ubuntu
Posts: 475

Original Poster
Rep: Reputation: 31
Thanks. I am so dumb. I didn't notice this different. Oh.....
 
  


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
Starting Java from shell script (Exception in thread "main") rolf_mueller Linux - Software 5 10-30-2004 02:11 AM
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window serve paragvd Programming 4 10-05-2004 03:35 AM
Java error "Exception in thread "main" java.lang.StackOverflowError" nro Programming 1 09-04-2004 03:47 AM
Exception in thread "main" java.lang.NoClassDefFoundError: Lobais Linux - Software 19 06-23-2004 08:42 AM
Exception "NoClassDefFoundError" from java degraffenried13 Linux - Software 8 09-11-2003 11:45 AM


All times are GMT -5. The time now is 11:52 AM.

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.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration