Reputation: 145
What is the name of the enviromental variable that netbeans IDE uses ?
Upvotes: 0
Views: 150
Reputation: 405765
This is probably because your class files are in a package. Say you have your .java files in a src directory and your classes compile to a bin directory. If your main class is in a package named org.example
then you'd run your program from the command line as follows (make sure you're in the bin
directory, not in src
):
C:\MyProject\bin> java org.example.MyClass
Upvotes: 0