Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Error: Could not find or load main class
Error: Could not find or load main class [message #1721841] Sun, 31 January 2016 23:34 Go to next message
Tyler Galske is currently offline Tyler GalskeFriend
Messages: 2
Registered: January 2016
Junior Member
I loaded up a Git repository on my desktop into Eclipse. I was working on the repo on my laptop but now I want to be able to work on my desktop. When I try to run the .java file, the console says: Error: Could not find or load main class. On my laptop I noticed there is a .class file and .project file but on my desktop there is no .class file, just a .project file. I'm not sure why the program won't run because it works fine on my laptop where I initially created the project. I didn't push all my project files using Git, just the .java file in the src folder and the .gitignore file outside the src file.

I am a newbie at Java and Eclipse so I would appreciate the help.
Thank you!
Re: Error: Could not find or load main class [message #1721968 is a reply to message #1721841] Mon, 01 February 2016 23:31 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

Tyler Galske wrote on Sun, 31 January 2016 18:34
I'm not sure why the program won't run because it works fine on my laptop where I initially created the project. I didn't push all my project files using Git, just the .java file in the src folder and the .gitignore file outside the src file.


Looking more closely at the differences would be a good idea. The .classpath file tells Eclipse where your source files are, and where they should be compiled to. Without it, it really has no idea what classes you're working on. Normally the JRE you're compiling against is referred to my its name in your Installed JREs preference page. You can make that more general and portable across machines by referring to it using an Execution Environment instead of directly by the name.


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:PHP Website to Android App?
Next Topic:open file read only
Goto Forum:
  


Current Time: Fri Apr 26 16:37:44 GMT 2024

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

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

Back to the top