• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error: Could not find or load main class myPackage.MyClass  RSS feed

 
Murphy Collins
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,
Please, I need help.
After running the following command:
java -cp ".;C:\temp\someOtherLocation;c:\temp\myJar.jar" myPackage.MyClass
on the commandline, I got the above header error message,
[Error: Could not find or load main class myPackage.MyClass].

I created MyClass in the folder "myPackage" exactly the same as the following directory
path:> [ C:\temp\myPackage ] yet the error message. Please, help!

Blessings,
iCode
 
Roel De Nijs
Sheriff
Posts: 11338
177
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you first compiled your class using javac? And which directory contains the resulting MyClass.class file?
 
Murphy Collins
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sheriff,
Thanks a million for your reply. Honestly, I didn't compile using javac.
Please, how do I do it since I am using the commandline this time around?
I have spoilt myself with IDESs and the problem here is that I am a
beginner. And I am not seeing any class file for the MyClass.java file
under the myPackage directory named [C:\temp\myPackage].
I am really lost here. Please save this greenhorn... lolzz

Blessings,
Murphy
 
Roel De Nijs
Sheriff
Posts: 11338
177
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here you'll find all info about javac
 
Murphy Collins
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roel,
Thank you so much for the Oracle link.
I will go through it thoroughly and just in case I still need help,
I will definitely keep you posted in here.

Once again, thank you so much.

Blessings,
Murphy Collins
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!