Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems running java

 
Mikael Molin
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
javafelen.jpg
[Thumbnail for javafelen.jpg]
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15495
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Rodrigo Tomita
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15495
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well this is the message i get:
Exception in thread"main java lang
javafelen.jpg
[Thumbnail for javafelen.jpg]
 
Mikael Molin
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok so should remove classpath totally ?
 
Mikael Molin
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes omg after hours and hours it happened i did it,
 
Campbell Ritchie
Sheriff
Pie
Posts: 50277
80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done getting it sorted, and welcome to JavaRanch
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic