There was a application from Apple called Jar Bundler
which got distributed by Apple with Xcode in the past.
The purpose of Jar Bundler
was to create Mac OS X application bundles (*.app
directories) for Java applications until version 6 (1.6.x) for Mac OS X user convenience.
As of now, you can still get
- JDK 1.6.0_43 from Apple
aka
- Java for OS X 2013-002 Developer Package Mar 4, 2013
for the current Mac OS X Mountain Lion 10.8.2 via
but you cannot get Jar Bundler
.
I'm using an up to date Mac OS X 10.8.2 and up to date Xcode 4.6 (4H127) with all Command Line Tools installed. After all research I did I would expect it here:
/usr/share/java/Tools/Jar Bundler.app
But there isn't any Jar Bundler
. Even a global search sudo find / -name Jar\ Bundler.app
did not really find Jar Bundler
.
So my question is: What is the last known Xcode version coming with Jar Bundler
Note: I know there are other ways to achieve what Jar Bundler
is doing here, like for example using Mac OS X JarBundler ANT Task or build the whole application package by hand, but thats not the question.
So looks like I have to answer the question my self. So don't punch me for that.
After intensive research and downloading all Java Developer Packages from Apple since 2012 til now (March 2013) it turns out its has nothing to do wit Xcode.
Jar Bundler
came in the past with Apples own Java Developer Packages. After trying them all out, one after another and inspecting them with Pacifist I found the following out:
Java for OS X 2012-005 Developer Package from 2012-09-06 was the last one installing the following Tools:
/usr/share/java/Tools/JavaVisualVM.app/ /usr/share/java/Tools/Jar Bundler.app/ /usr/share/java/Tools/Applet Launcher.app/
starting with
Java for OS X 2012-006 Developer Package from 2012-10-16
/usr/share/java/Tools
directory gets removed by the installation of this package, but there are no new /usr/share/java/Tools/*.app
s re-installed anymore by the same package.
Even re-installation of 2012-005 after /usr/share/java/Tools
directory got removed by 2012-006 doesn't bring you back the Jar Bundler.app
.
So the only way to get Jar Bundler.app
back after you lost it while some Apple Java Developer Package update exercises you need to do the following :
- Get Pacifist or some other tool of your choice who can deal wit
*.pkg
files. - Open Java for OS X 2012-005 Developer Package with it.
- Ctrl-Click
JavaDeveloper.pkg\JavaTools.pkg\Jar Bundler.app
- Choose
Install to Default location
- open
Terminal.app
open /usr/share/java/Tools/Jar\ Bundler.app/
Thats it and don't forget to back it up.
To understand which Apple release number belongs to which JDK/JRE version numbers, see below:
Java for OS X 2012-005 Developer Package from 2012-09-06
$ java -version java version "1.6.0_35" Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M4203) Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)
Java for OS X 2012-006 Developer Package from 2012-10-16
$ java -version java version "1.6.0_37" Java(TM) SE Runtime Environment (build 1.6.0_37-b06-434-11M3909) Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01-434, mixed mode)
Java for OS X 2013-001 Developer Package from 2013-02-19
$ java -version java version "1.6.0_41" Java(TM) SE Runtime Environment (build 1.6.0_41-b02-445-11M4107) Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01-445, mixed mode)
Java for OS X 2013-002 Developer Package from 2013-03-04
$ java -version java version "1.6.0_43" Java(TM) SE Runtime Environment (build 1.6.0_43-b01-447-11M4203) Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01-447, mixed mode)
The official replacement for JarBundler is the javapackager tool.
As an example of its use, a simple, well explained, step by step tutorial for making OSX apps from a java source is here: http://centerkey.com/mac/java/ .
In short, if you want Jar Bundler, install "OS X 2012-005 Developer Package". More recent packages have it removed.
Jar Bundler is retired now and will not work for projects requiring Java 7 and up. Check this other StackOverflow question «Bundle a Java 7 .jar for Mac» for more details.
The solutions mentioned in this question will in all likelihood continue to function, but only for projects up to Java 6.
As a developer with Pyxis Software, I would like to add that we have developed a small inexpensive application called Pyxis Bundler that makes it really easy to create Mac application bundles.
We designed it as a replacement for the Jar Bundler application that was previously shipped with Xcode.
To use Pyxis Jar Bundler you will need a minimum of three items:
- Runnable jar file (myApplicatin.jar)
- An icon file (myIcon.icns)
- A Splash file (mySplashImage.png)
Then simply enter your application name, version number, ram requirements, your package name, main class name, and a few other items. Next click Create and that's it, your application is bundled into a standard Mac Bundle.
Note that any Application created is saved to a preferences file. What this means is that bundling updates is simply a matter of choosing your application name from a drop-down list and incrementing the version number and then clicking the Create button.
More information is available here.
On El Capitan and Java 9, java packager
is installed here:
"/Library/Java/JavaVirtualMachines/jdk-9.x.x.jdk/Contents/Home/bin/javapackager"
Make an alias:
alias javapackager="/Library/Java/JavaVirtualMachines/jdk-9.x.x.jdk/Contents/Home/bin/javapackager"
Just do this:
- right click on install OS X Mountain Lion.app
- show package contents
- go inside Contents/SharedSupport/ and mount InstallESD.dmg
Now you have to go inside this folder: Packages. You'll find JavaEssential.pkg and JavaTools. Jar bundler is in JavaTools.pkg.
来源:https://stackoverflow.com/questions/15375490/why-is-jar-bundler-gone-in-mac-os-x-mountain-lion-10-8-2