File will not compile

M

Mike Campo

I recently got the Java SDK installed and I found a tutorial on the
net about creating your first program. I put the code in notepad,
saved it as MyProgram.java and ran javac. It created a class file, but
when I try to compile that with java it gives me the following error:

Exception in thread "main"java.lang.NoClassDefFoundError: MyProgram

I have no idea what that means. Is it my source code thats causing the
problem, or did I mess up when installing the SDK. Heres my source
code. I dont understand it all right now, so any help is appreciated.

public class MyProgram {

public static void main(String[] args) {
System.out.println(
"Hello World.");
}
}
 
A

Andrew Thompson

I recently got the Java SDK installed and I found a tutorial on the
net about creating your first program. I put the code in notepad,
saved it as MyProgram.java and ran javac. It created a class file, but
when I try to compile that with java it gives me the following error:

The best group for these kind of questions is..
<http://www.physci.org/codes/javafaq.jsp#cljh>

The people there are much nicer..
I have set the F'Ups to that group.
Exception in thread "main"java.lang.NoClassDefFoundError: MyProgram

I have no idea what that means.

The Java Glossary has a good page explaining
most of these errors..
<http://mindprod.com/jgloss/errormessages.html#NoClassDefFoundError>

He also has some good tips for starters..
<http://mindprod.com/jgloss/gettingstarted.html>

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top