aspose file tools*
The moose likes Beginning Java and the fly likes Problems running java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problems running java" Watch "Problems running java" New topic
Author

Problems running java

Mikael Molin
Greenhorn

Joined: Jul 31, 2009
Posts: 12
Hi i have a problem running the java, i have installed it and compiled it ,everything is working untill the very last part when i have to run it,it doesnt work, it says something that coulnd not find the main class programm will exit.it also says exception inthread, srry if my english is bad, i am attaching a photo so you can se what it says.
Regards
Mikael


[Thumbnail for javafelen.jpg]

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14352
    
  22

Welcome to JavaRanch.

You didn't attach the picture. What exactly did you do and what error message do you get exactly? Did you set your classpath? Sun's Hello World tutorial explains step by step what to do to write, compile and run your first Java program, and it also discusses frequently encountered errors for new users, like what you describe.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Rodrigo Tomita
Ranch Hand

Joined: Apr 28, 2008
Posts: 70
Hi, Mikael,

I think you could check the Java Beginners FAQ, especially the questions 2 (How do I run my very first Java program?) and 9 (Classpath, what is it and how do I set it?).

Good luck
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14352
    
  22

Ok, now you added the picture.

Make sure that your CLASSPATH is not set and try again. With Java 5 or 6 you do not need to set your CLASSPATH, and it is better to not set it at all.

Alternatively, make sure the current directory "." is in your CLASSPATH.
Mikael Molin
Greenhorn

Joined: Jul 31, 2009
Posts: 12
well this is the message i get:
Exception in thread"main java lang


[Thumbnail for javafelen.jpg]

Mikael Molin
Greenhorn

Joined: Jul 31, 2009
Posts: 12
ok so should remove classpath totally ?
Mikael Molin
Greenhorn

Joined: Jul 31, 2009
Posts: 12
Yes omg after hours and hours it happened i did it,
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39885
    
  28
Well done getting it sorted, and welcome to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems running java