Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Carlton Martinez   on Dec 12 In Java Category.

  
Question Answered By: Julian Long   on Dec 12

I think the problem is not in your package path, I mean try that too,
but I get the same error  whenever lets say i have file
Main.java and inside is a class  called class House

Now when you compile it is javac Main.java,
but when you run  you do not call java  Main.java or java Main
You must call the name of the class which in this case is House
so
java House
should compile without error

Remeber name of the file when you compile but name of the Driver class
(the one that executes main() ) when running the application

Share: 

 

This Question has 9 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on compilation error Or get search suggestion and latest updates.


Tagged: