Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Error message Cant find class or load main
Error message Cant find class or load main [message #1836677] Tue, 12 January 2021 00:26 Go to next message
Travis Tzer is currently offline Travis TzerFriend
Messages: 1
Registered: January 2021
Junior Member
Hi I am using Eclipse 20-12 to try to write Java code. Via Java SE Develop Kit 11.0.9. in Windows 10.
I am getting this error

Error: Could not find or load main class MySweetProgram
Caused by: java.lang.ClassNotFoundException: MySweetProgram



public class MySweetProgram {

public static void main(String[] args) {
System.out.println("Hello World!");

}

}

and I not including something in the code or possibly compiler was installed wrong ? Thanks in advance
Re: Error message Cant find class or load main [message #1836679 is a reply to message #1836677] Tue, 12 January 2021 04:39 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

Have you tried putting your class somewhere other than the Default Package (i.e. by creating a New Package and dragging the class into it)? And does this message happen when using Run As->Java Application from inside Eclipse with the class selected?

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:Window Builder. HELP ME!
Next Topic:Eclipse RCP Application (using p2 repo) Build automation using Ant
Goto Forum:
  


Current Time: Sat Apr 27 05:17:26 GMT 2024

Powered by FUDForum. Page generated in 0.07613 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top