LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 11-10-2011, 10:20 PM   #1
maheshbaria99
LQ Newbie
 
Registered: Nov 2011
Location: Godhra
Distribution: it news
Posts: 1

Rep: Reputation: Disabled
i get the error "Exception in thread "main" java.lang.NoClassDefFoundError: Hello"...


i get the error "Exception in thread "main" java.lang.NoClassDefFoundError: Hello"...give me suggestion how to solve this problem
public class Hello
{
public static void main(String args[])
{
System.out.println("Hello world");
}
}
 
Old 11-11-2011, 01:47 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
First of all, when posting code here, you should put it between [code] and [/code] to preserve indentation and aid readability.

Also, your thread should be in the Programming forum, so I've reported it for moving there.

Have you compiled the code with javac? If so, are you in the same directory in which Hello.class resides? If not, you should be able to give the argument -cp (or -classpath) and give the path to the directory containing Hello.class. I think you can also set the CLASSPATH environment variable.
 
Old 11-13-2011, 02:13 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Moved: This thread is more suitable in <PROGRAMMING> and has been moved accordingly to help your thread/question get the exposure it deserves.
 
  


Reply



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
Java runtime error. Exception in thread "main" java.lang.NoClassDefFoundError: / Priyadivya Red Hat 2 10-26-2010 05:01 AM
Exception in thread "main" java.lang.NoClassDefFoundError: org/aspectj/lang/Signature canonas Linux - Software 3 06-16-2008 04:00 AM
Exception in thread "main" java.lang.NoClassDefFoundError: LinuxNewbie999 Programming 2 03-24-2008 12:12 AM
Exception in thread "main" java.lang.NoClassDefFoundError: Lobais Linux - Software 19 06-23-2004 08:42 AM
Exception in thread "main" java.lang.NoClassDefFoundError: melinda_sayang Programming 2 04-27-2004 11:49 AM

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

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