• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java on Macs

 
Christopher Arthur
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been developing java on Windows, but I want to distribute my program so that Mac users can run it. On Windows, I've been making a .BAT file with the java command like:

java -classpath $CLASSPATH$;myjar.jar;myjar2.jar myPackage.myClass

Actually I would love also to know a more sophisticated way to launch a java program, like being able to click on an icon that doesn't look like a cog in a window, but that's another matter. I'm more concerned about how I would run my program on a Mac. Any suggestions?

Chris
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could create a shell script similar to your bat file. That would work on any UNIX platform including OS X.

There are ways to create Mac-specific clickable icons (I think I remeber a program named Platypus or something like that that helps create the application package).
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Mac OS forum...
 
Warren Dew
blacksmith
Ranch Hand
Posts: 1332
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you put your program into a single .jar file and put a manifest in it that says where the main() program is located, the jar file will start with a double click on Mac OS 10.2.8. It might not work on older versions of the operating system, though.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic