Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Error: Could not find or load main class jdk1.8.0_60 in eclipse  RSS feed

 
SuvenduSekhar Panda
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am trying to run a java program from eclipse but when I ran the program, I got the following error message.
"Error: Could not find or load main class jdk1.8.0_60"

I tried to solve the issue using the following steps but no luck

1.opened buildpath> Libraries> Jre system library
2. changed the JRE library to the system mentioned JDK

But after doing the following steps also I am not able to resolve it.

Can anyone help on this? and let me know what is missing here?

PFA screenshot for your reference.

Best Regards,
Suvendu
JDK_Error.jpg
[Thumbnail for JDK_Error.jpg]
 
Knute Snortum
Sheriff
Posts: 3612
86
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this: Windows -> Preferences -> Installed JREs.  Highlight your Java 8 JRE and press the edit button.  Everything look okay?  Does the JRE say jdk1.8.0_60?
 
SuvenduSekhar Panda
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, I am using jdk1.8.0_60 instead of JRE 1.8.0.60.
PFA reference attached screenshot.
reference.JPG
[Thumbnail for reference.JPG]
 
Knute Snortum
Sheriff
Posts: 3612
86
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a C:\Program Files\Java\jdk1.8.0_60\jre\lib folder with the correct jars in it?
 
Knute Snortum
Sheriff
Posts: 3612
86
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you running this?  What does your Run Configuration look like?
 
SuvenduSekhar Panda
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.
 
SuvenduSekhar Panda
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I simply right click the java application as mentioned in the previously attached screen shot. and the the configuration is like below attached screenshot.

Please let me know If I am going wrong?
config.JPG
[Thumbnail for config.JPG]
 
Knute Snortum
Sheriff
Posts: 3612
86
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm... try right-clicking the program, select Run As... select Java Application.  If there's an error, copy and paste the entire text.
 
SuvenduSekhar Panda
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is only error message displayed in the console. As seen in the previous screen shot.

Error: Could not find or load main class jdk1.7.0_79

 
Knute Snortum
Sheriff
Posts: 3612
86
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you run any other projects in Eclipse?  Can you run from the Run Configuration window? (Press the Run button)  Can you run from the Play button in the toolbar?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!