Zo72
Zo72

Reputation: 15305

Batch file to run a java app. How to port it in Mac?

I have a tiny batch file to kick off my java app:

its code is something as simple as

java -jar myapp.jar 

(in reality it's slightly more complicated as we set a few properties)

A friend of mine has a mac. He has java installed on his mac. But how do we run this batch from mac ?

Upvotes: 2

Views: 1856

Answers (2)

Andrew Thompson
Andrew Thompson

Reputation: 168815

If the Java app. is a desktop app. with a GUI, a good way to launch it is using Java Web Start. JWS provides the ability to set properties in the JNLP launch file.

JWS works on all desktop JREs. E.G. it will work on Windows, Mac. and *nix.

Upvotes: 1

Chris Ledet
Chris Ledet

Reputation: 11628

Put the following code into a file and run chmod +x <filename> to make it executable.

#!/bin/sh
java -jar myapp.jar 

Upvotes: 5

Related Questions