Tuesday, November 6, 2012

How to run this java class in command line in windows?

You would run
java com.test01.test01
but having a class with the same name as a package is a really bad idea (as well as not following the Java naming conventions).
You'd need to run it with the relevant class on the classpath. For example, you could just compile it like this (from the "root" of your source tree):
javac -d . [path to source file]
java com.test01.test01
or if you've got your source organized appropriately already:
javac com\test01\test01.java
java com.test01.test01
 
http://stackoverflow.com/questions/6314648/how-to-run-this-java-class-in-command-line-in-windows

No comments:

Post a Comment