0

I'm having troubles with my jar files here. I'm kind of a beginner in Java and I wanted to make a .jar file in order to share my little first program with a friend of mine. It's a 2 classes program, they depend on each other and work together when compiling and running. I created a MANIFEST.MF file and created a .jar using the command line.

All seem to work, when I type: java -jar myApp.jar it works. But when I double-click my myApp.jar file, I expect a terminal window to open and print out some things and nothing happens...

(I'm on Mac OS X Yosemite)

Chibi
  • 103
  • 1
  • 11
  • it doesn't have to open terminal window, unless you are explicitly from your Java code opening it, check what program it tries to open with – jmj Sep 05 '15 at 01:10
  • @JigarJoshi How do I check that? I thought using System.out.println("Hello"); would be enough to open a terminal window that prints Hello, isn't it so? – Chibi Sep 05 '15 at 01:12
  • try to change your code that writes a file, and execute it to validate – jmj Sep 05 '15 at 01:15
  • @JigarJoshi I may have misunderstood what you meant: I can't find how to get the program it tries to open with – Chibi Sep 05 '15 at 03:51
  • I suspect that your program gets executed but since it is just printing on console, you don't see any effect, so I am asking you to create a file when your program runs, to verify this thing – jmj Sep 05 '15 at 03:52
  • @JigarJoshi Oh. Then yes it runs and successfully creates a file – Chibi Sep 05 '15 at 03:55
  • Yes, but still it doesn't open the console when I want to print something. I use `System.out.println("foobar");` and I don't understand where it prints that – Chibi Sep 05 '15 at 04:12
  • 1
    http://stackoverflow.com/questions/14544690/java-mac-windows-with-system-out-println – jmj Sep 05 '15 at 04:18
  • I thought it would be logged into the terminal. That's why I couldn't see anything. Thanks for your help – Chibi Sep 05 '15 at 04:25

0 Answers0