14

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.

Slipp D. Thompson
  • 33,165
  • 3
  • 43
  • 43
Uwe Günther
  • 2,971
  • 2
  • 21
  • 26
  • No idea when they removed it, but I still have a copy on my system - it's in with all the other java tools. If you can't get a definitive answer, then you can probably try a binary chop to determine when it was removed – Anya Shenanigans Mar 13 '13 at 18:02
  • @Petesh On which path is it exactly on your box. Which Version of Mac OS X and Xcode do run? Would be greate if you could tell me the path of the java tools, so maybe I find it on the time capsule. Thanks – Uwe Günther Mar 13 '13 at 18:09
  • Exactly where you specify - `/usr/share/java/Tools/Jar Bundler.app`, along with a couple of other tools. `Mac OS X 10.8.2`, `XCode 4.6 (4H127)`. – Anya Shenanigans Mar 13 '13 at 18:12
  • @Petesh Bummer, why is it gone on my box. Whats your Java 6 version? Is it 1.6.0_43 from March 4th 2013? – Uwe Günther Mar 13 '13 at 18:16
  • java 1.6 version is identical to yourself. I Don't have far enough a history in my time machine to go back to before they were installed (June 20, 2012). Based on that date I'd guess XCode 4.3.3 was the last revision to have it, so it was pulled around the same window as other tools like Icon Composer – Anya Shenanigans Mar 13 '13 at 18:22
  • @Petesh I have tool called `Pacifist` where you can look in to `dmg` and `pkg` files. So I am downloading all the `JDK`s from Apple from 2012 til now and do some research. There are also old `Xcode`s available with their command line packages. So I will let you know and if I find a solution I post an answer :-) Thanks for your help so far – Uwe Günther Mar 13 '13 at 18:30
  • @Petesh Found the issue: http://stackoverflow.com/a/15397645/287984 It was extremely painful to dig that out. This Java transition from Apple to Oracle isn't really well thought, I have to say. It looks to me Apple forces us to go to for Oracle Java 7. – Uwe Günther Mar 14 '13 at 01:56
  • As of JDK14 you can also use **`jpackage`** as shown in this answer: https://stackoverflow.com/a/66511673/191246 – ccpizza Mar 06 '21 at 23:40

7 Answers7

27

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:

starting with

directory gets removed by the installation of this package, but there are no new /usr/share/java/Tools/*.apps 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 :

  1. Get Pacifist or some other tool of your choice who can deal wit *.pkg files.
  2. Open Java for OS X 2012-005 Developer Package with it.
  3. Ctrl-Click JavaDeveloper.pkg\JavaTools.pkg\Jar Bundler.appPacifist with Java for OS X 2012-005 Developer Package from 2012-09-06
  4. Choose Install to Default location
  5. open Terminal.app
  6. 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)
    
Uwe Günther
  • 2,971
  • 2
  • 21
  • 26
  • @Petesh But you know, Oracles [`appbundler`](http://java.net/projects/appbundler/) Ant task is only working for Oracles own Java 7 packages on Mac OS X. So without having `Jar Bundler.app` you have to go for 3rd party [Mac OS X JarBundler ANT Task v2.2.0](http://informagen.com/JarBundler/) from sourceforge. – Uwe Günther Mar 14 '13 at 09:19
  • 1
    The transition to Oracle JDK 7 has not been smooth (especially for [retina machines](http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8000629)). I use build scripts and automation because that's what works consistently (so I use appbundler/jarbundler where appropriate). As to the 'Why was it removed'? question - it is a business decision by Apple. They've stopped supporting it and handed all future development of java to Oracle. TBH Apple's been killing java support off since the 10.5 time frame, so this is just another nail in the coffin. 2¢ commentary – Anya Shenanigans Mar 14 '13 at 10:52
  • 3
    I, for one, am grateful for this very detailed analysis and report by Uwe. – mhucka Apr 11 '13 at 00:59
  • This is a great answer. Even though after going through all the steps I found out that Jar Bundler.app was already on my system just not in my path. I also found out about Pacifist.app. – Eric Apr 22 '13 at 14:02
  • 2
    @Petesh Legacy solutions are never a bad thing. While there are newer solutions that are recommended, the old solution (Jar Bundler.app) still works; and some of us need it only for one-off personal quick solutions.  Setting up and learning a new tool isn't necessary when the old tool still does what very little I (and others) need. – Slipp D. Thompson May 03 '13 at 18:57
  • 3
    You can also extract with the command line tool `xar` - e.g. `xar -xf JavaDeveloper.pkg`. The package contains other `.pkg` *files* that are actually directories. Those in turn can be extracted using `tar`, since the `Payload` files are tar archives: `tar -xf Payload`. Both `xar` and `tar` are standard OSX command-line tools. – dualed May 14 '14 at 13:19
  • 1
    Thanks to dualed. Thats it! I tried to "un"xar a *.pkg and to untar the contained Payload file and it worked perfect with a random pkg file I found on my disk. Great tip! – Uwe Günther May 14 '14 at 21:31
  • Thanks for sharing your answer, as the answer is back to 2013, have you came across any better solution for the problem? My application is Maven based, do you think your solution would work for me ? – Jack Jan 07 '15 at 03:37
3

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

Marco
  • 423
  • 5
  • 7
2

In short, if you want Jar Bundler, install "OS X 2012-005 Developer Package". More recent packages have it removed.

Yam
  • 21
  • 2
0

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.

Community
  • 1
  • 1
jornane
  • 1,397
  • 10
  • 27
0

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:

  1. Runnable jar file (myApplicatin.jar)
  2. An icon file (myIcon.icns)
  3. 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.

Opal
  • 81,889
  • 28
  • 189
  • 210
0

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"

saqe hi
  • 181
  • 2
  • 8
-1

Just do this:

  1. right click on install OS X Mountain Lion.app
  2. show package contents
  3. 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.

Jamal
  • 763
  • 7
  • 22
  • 32
Eshria
  • 1