Jump to content

Java question


NOFX

Recommended Posts

I install jsdk and my editor. I can compile sucessfully, when I try to execute I always get

 

"Exception in thread "main"

 

almost 100% sure its not the code, because I have tried a few different sources

Link to comment
Share on other sites

What is the full error message?

 

The "proper" way to compile a java program is:

javac MyClass.java

The "proper" way to run a java program is:

java MyClass

 

If the message is:

Exception in thread "main" java.lang.NoClassDefFoundError: UploadLuminexData/java

 

Then your mistake is that you are typing

java MyClass.java

 

If your error message is

Exception in thread "main" java.lang.NoSuchMethodError: main

Then you have no properly described main.

 

If its none of this, post up the error message.

 

Main should be in your class and, be

public static void main(String[] args)

 

Java will not accept main any other way and the class that you are calling MUST have a defined main.

Edited by White Knight
Link to comment
Share on other sites

bah Im a total noob, I was trying to execute the wrong class...Im in Java 3 right now white so I might have a few more questions :)

Any time man...java is my specialty. One request though...when you ask a question, please be a bit more verbose than...hey I got an error in my main. Helps a bit. ;)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...