LinuxQuestions.org
Visit the LQ Articles and Editorials section
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, 11: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, 02: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, 03:13 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

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


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


All times are GMT -5. The time now is 08:51 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration