• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problems running java

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok so should remove classpath totally ?
 
Mikael Molin
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes omg after hours and hours it happened i did it,
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well done getting it sorted, and welcome to JavaRanch
 
reply
    Bookmark Topic Watch Topic
  • New Topic