Reputation: 6302
I have a class file build by maven. It is just one class with main method in it. The file situates under:
<projectRoot>/target/classes/com/myproject/client/MyClass.class
The class is in package:
com.myproject.client
The class has no dependency on other classes.
My question is that how can I run it using the "java" command line.
Many thanks.
Upvotes: 0
Views: 77
Reputation: 5259
Try this:
java -cp "<projectRoot>/target/classes" com.myproject.client.MyClass [optional arguments]
Upvotes: 2