Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see System.out for executable jar?

Tags:

java

eclipse

jar

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?

like image 533
membersound Avatar asked Oct 01 '12 13:10

membersound


People also ask

How do I run an executable JAR file from an argument?

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 …]


1 Answers

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

like image 173
Martin Wilson Avatar answered Oct 22 '22 03:10

Martin Wilson