Utilizzo jarbundler 2.2.0 come suggerito da altre risposte poiché l'applicazione deve essere eseguita su JRE 1.6 di Apple.Java Application Bundled per Mac non viene avviato
Il pacchetto sembra essere giusto, mostra con l'icona appropriata ma facendo clic su di esso non fa nulla. Se vado nel suo contenuto e prova doppio clic sul vaso con il file principale specificato funziona bene.
C'è un modo per vedere cosa sta succedendo? Qualche tipo di errore o registro che posso vedere?
Modifica Richiesto Info.plist. Dal momento che il codice è privato ho sostituito alcune cose con Application:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>Application</string>
<key>CFBundleShortVersionString</key>
<string>2.2.0</string>
<key>CFBundleGetInfoString</key>
<string>Application version</string>
<key>CFBundleAllowMixedLocalizations</key>
<string>false</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleExecutable</key>
<string>JavaApplicationStub</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>beta</string>
<key>CFBundleIconFile</key>
<string>SynamicD.icns</string>
<key>CFBundleIdentifier</key>
<string>net.sourceforge.javydreamercsw</string>
<key>Java</key>
<dict>
<key>MainClass</key>
<string>net.sourceforge.javydreamercsw.Main</string>
<key>JVMVersion</key>
<string>1.6.*</string>
<key>ClassPath</key>
<array>
<string>$JAVAROOT/Application.jar</string>
<string>$JAVAROOT/lib\lib1.jar</string>
<string>$JAVAROOT/lib\lib2.jar</string>
</array>
<key>Properties</key>
<dict>
<key>apple.awt.textantialiasing</key>
<string>true</string>
<key>apple.awt.brushMetal</key>
<string>true</string>
<key>apple.laf.useScreenMenuBar</key>
<string>true</string>
<key>apple.awt.showGrowBox</key>
<string>true</string>
</dict>
</dict>
</dict>
</plist>
Contenuto del PkgInfo:
APPL????
Sulle Application.app/Contents/MacOS ho la JavaApplicationStub dal Mac macchina.
risultante struttura del file:
Application.app
|
---Contents
|
---Info.plist
---PkgInfo
---MacOS
|
| ---JavaApplicationStub
---Resources
|
---Java
|
----lib
|
---lib1.jar
|
---lib2.jar
|
---Application.jar
|
---Application.icns
uscite pregati di comandi:
~ $ java -version
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
~ $ sw_vers -productVersion
10.8.2
~ $ /usr/libexec/java_home -V
Matching Java Virtual Machines (4):
1.7.0_17, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home
1.7.0_15, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_15.jdk/Contents/Home
1.6.0_43-b01-447, x86_64: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
1.6.0_43-b01-447, i386: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home
~ $ /usr/libexec/java_home
/Library/Java/JavaVirtualMachines/jdk1.7.0_17.jdk/Contents/Home
~ $ echo $JAVA_HOME
~ $ echo $JAVA_ARCH
~ $ /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -version
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
~ $ ls /Library/Java/JavaVirtualMachines
jdk1.7.0_15.jdk jdk1.7.0_17.jdk
~ $ /System/Library/Frameworks/JavaVM.framework/Commands/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)
~ $
Non conosco il modo migliore per creare un pacchetto per Java, ma una rapida occhiata a FreeMind (freemind.sourceforge.net) mostra che hanno una directory Java con il jar in Risorse e un collegamento JavaApplicationStub nel suo contenuto. – koan
Anche io ce l'ho. – javydreamercsw
Qual è il valore di 'CFBundleExecutable' nel Info.plist del bundle? Dovrebbe essere il nome del file binario nella cartella MacOS. – joerick