problem.jpg
Hi When I try to run my program in Eclipse I receive this statement " Error: Could not find or load main class Program". I don't know what Should i do with this problem. It is my first program, which I try run in Eclipse.
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
problem.jpg
Hi When I try to run my program in Eclipse I receive this statement " Error: Could not find or load main class Program". I don't know what Should i do with this problem. It is my first program, which I try run in Eclipse.
Are there any compiler errors? Copy the full text of the error messages and paste it here. If there are no compiler errors, Try running the code in a command prompt. If there are errors, copy the full text of the error messages and paste it here.
If you don't understand my answer, don't ignore it, ask a question.
problem2.jpg
I hope that you need this...
Please copy the text and paste it here, not an image. Images are hard to see and text can not be copied from an image when writing a response.
If you don't understand my answer, don't ignore it, ask a question.
Notice the red squigglies under Program and String and the boxes along the left margin with the red 'x' in them. Hovering your mouse over any of those items will give you the reasons for the red squigglies red 'x's - error messages. You can even mouse into the message when they come up and then copy them for posting.
In this specific instance where you've also shown us the Problems view at the bottom, Eclipse is complaining because your project or development environment has not been setup correctly as indicated by the, "Unbound classpath container" message. You can research this further by Googling, but it sounds like you either haven't installed the JDK, the appropriate JDK, or told Eclipse where to find it if you have. Review your Eclipse "getting started" instructions to ensure you've done all that correctly.
now I have other problem. Because I reinstalled my JDK and Now I see other statement "The specified JRE installation does not exist" when I try run the program . Could you advice me step by step what I should do?
Thread moved.
Note where you installed the JDK. If you open a command window and type javac -version <return>, what response do you get?
In Eclipse, select Window, Preferences. In the left-hand browser of the resulting interface, expand Java, and highlight Installed JREs. The JDK you've installed may or may not appear to the right. If the JRE displayed is incorrect, select Add and navigate to where you installed the JDK. Once the root folder of the currently installed JRE is correctly displayed, select it as the default (check mark to the right), then highlight any other JREs shown one at a time and delete them.
Then return to your project and see if the program will compile and run. If not, return and give us any errors you're getting.