0

I've probably just done something quite stupid, and renamed / changed the order of the packages in my project manually via the src folder at eclipse workspace.

After doing that I had to fix every class seperately and rewrite the package it belongs to, on its top line.

The problem is that now, it seems like my project doesn't even recognize its classes. they don't show an error if they have one, while the project itself always shows a red error. When I run the project I get

Error: Could not find or load main class".

I tried Project -> Clean or manually choosing the main class, but it didn't work.

Arnab
  • 4,216
  • 2
  • 28
  • 50
Niv Kor
  • 182
  • 1
  • 9
  • You have to fix build errors first. Please add the error message of this/these build error(s) (which can be found in the _Problems_ view) to your question. – howlger Aug 29 '18 at 10:34
  • "The project was not built due to "A resource exists with a different case: '/Mortal Lives Matter/bin/Map'.". Fix the problem, then try refreshing this project and building it since it may be inconsistent". I didn't know there was a problems view window and it pretty much getting me closer to the problem. should I just remove the bin folder or something like that? – Niv Kor Aug 29 '18 at 10:39
  • Yes, but make sure `bin` is correctly configured as output folder and not as source folder in _Project > Properties: Java Build Path_, tab _Source_, delete everything in `bin` and try again _Project > Clean..._. – howlger Aug 29 '18 at 11:16

1 Answers1

1

A good explanation of this error can be found here:

An explanation

Another explanation

By manually renaming package you change all references (even those you might not know about - for example auto-imports). It is usually never a good idea to rename manually in eclipse or even the explorer (on windows). Use "Refactor" to do this - right-click the package and select this option. This will rename all references to the package and the package itself.

Changing the order of the packages manually will cause the same issue. Package names will not be correct anymore. Therefore, you should let eclipse do the work for you by selecting the appropriate option for what you want to achieve.

Community
  • 1
  • 1
CrimsonMike
  • 263
  • 1
  • 13