I have a little java tool that should make some console output by System.out.println()
.
But if I export it as runnable jar and run it by javaw.exe -jar path\to\myfile.jar
, it is executed but there is no output on the console!
What might I be doing wrong?
Run a Nonexecutable JAR with Arguments To run an application in a nonexecutable JAR file, we have to use -cp option instead of -jar. We'll use the -cp option (short for classpath) to specify the JAR file that contains the class file we want to execute: java -cp jar-file-name main-class-name [args …]
javaw.exe
does not have a console associated with it. you need to use java.exe
. If java is not on the path, enter the full path, e.g. path\to\java.exe -jar path\to\myfile.jar
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With