Ray Whiteside
Ray Whiteside

Reputation: 23

Executable Jar not Displaying Output

I have an executable jar that I know is executing, because I put two distinct beeps at the beginning of the code that I hear whenever I double click on it or when I run it through the cli. Even when I run it through the command line however, it does not display output nor prompt for input when I use System.out/System.in respectively. Everything is functional when I run it through eclipse.

How do I get the .jar to output/input to the same command line I executed it in?

Upvotes: 1

Views: 2495

Answers (1)

Eric Citaire
Eric Citaire

Reputation: 4513

Assuming java is in your PATH, you should lauch your program as follows :

java -jar myProgram.jar

If you want to run it without opening the command line, you could create a .cmd file in the same directory with this content :

@echo off
java -jar myProgram.jar
pause

then, double-click on the .cmd file.

Upvotes: 3

Related Questions