• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Java on Macs

 
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
 
Marshal
Posts: 67279
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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).
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Mac OS forum...
 
blacksmith
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.
 
She said she got a brazillian. I think owning people is wrong. That is how I learned ... tiny ad:
Enterprise-grade Excel API for Java
https://products.aspose.com/cells/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!