aspose file tools*
The moose likes Mac OS and the fly likes Java on Macs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Mac OS
Bookmark "Java on Macs" Watch "Java on Macs" New topic
Author

Java on Macs

Christopher Arthur
Ranch Hand

Joined: Mar 09, 2004
Posts: 149
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

Joined: Jan 10, 2002
Posts: 60048
    
  65

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).


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Moving this to the Mac OS forum...


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Warren Dew
blacksmith
Ranch Hand

Joined: Mar 04, 2004
Posts: 1332
    
    1
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Java on Macs
 
Similar Threads
testing cross platform
CLASSPATH Environment Variable
Need some help...
Default font is bigger on Mac/Linux than Windows
Move to Mac OS