maloney
maloney

Reputation: 1653

Could not find or load main class error

I'm having trouble running my java application from the command line. This is what I am trying to run:

C:\Users\workspace\project>java -cp .\bin\calculator CalculatorController.class

All the class files are in the calculator folder and the main class is in the CalculatorController.class. Can anyone spot what im doing wrong?

Upvotes: 0

Views: 236

Answers (1)

Bhushan
Bhushan

Reputation: 6181

Try this: Remove .class and give proper path

C:\Users\workspace\project>java -cp .\bin\calculator\CalculatorController

.class extension is not required while running java class.

Upvotes: 1

Related Questions