Qvatra
Qvatra

Reputation: 3857

Why does a jar file work differently with and without console?

I obtain different results using the same program when I run it thru:
1)..\Desktop\app.jar
2)..\Desktop\java -jar app.jar
second case gives the same result that I saw in eclipse but it uses console.
Question is: How do I force my program to work properly (to give the same result as in eclipse) by direct executing app.jar (without console)?

Upvotes: 1

Views: 152

Answers (1)

tcb
tcb

Reputation: 2814

Use javaw instead of java in command line:

..\Desktop\javaw -jar app.jar

More information: http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/java.html

Upvotes: 3

Related Questions