Before you mark this as a duplicate, please hear me out.
I am trying to import a java project with gradle(Fully functional, works for every other laptop with no issues).
My project is 100% functional, it works on every other laptop
This issue started when my laptop was reimaged an set as windows 10
I have configure the Environment variables,
JAVA_HOME = C:\Program Files\Java\jdk1.8.0_161
, in PATH I've addedC:\Program Files\Java\jre1.8.0_161\bin
Command line I am seeing the correct version. (Java -version)
I right clicked my project "configure build path". I ensured that it is the latest version I mentioned in my environment variable (1.8.0_161).
I've imported my project, clean build, refreshed and ran (shows Cannot find or load main class)
In the command line, I did
gradle clean build
builds successfully with no errorI also ran my java application
java -jar app.jar
My applications starts up and runs on localhost:8080I created a test project a simple hello world, and it is running with no issues.
So, My question stands what is causing this cannot load main class error in ECLIPSE and in Spring tools suite IDE?
PS: I do not have any misconfigure packages(as I mentioned project works perfectly find on any other laptop) Also, I have deleted Eclipse(.p2, .eclipse, eclipse and eclipse workspace folder), Java, and gradle and reinstalled all of the multiple times.
UPDATE
As mentioned above (#8) it will work if I run the .jar application.
I also tried running my java application thru command prompt
java C://.......myMainApp.java
Error: Could not find or load main class com.jesse.umsswap.app.myMainApp
Edit not duplicated
As I mentioned in this post, The two links provided by Jarrod did not resolve my issue. I have gone thru those two post and the solutions did not solve mine.
PS
Have you ever had a working java project in git, but when you cloned it is saying "cannot load or find main class"?