Tips, Tricks, and Hidden Knowledge of Java Packager · Tricks • Some of these tricks are...

Post on 04-Jun-2018

221 views 0 download

transcript

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted

Tips, Tricks, and Hidden Knowledge of Java PackagerBOF1747

Chris Bensen Principal Member of Technical Staff Java Client Deployment and Performance September 09, 2016

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |

Safe Harbor Statement

The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.

Confidential – Oracle Internal/Restricted/Highly Restricted 4

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted

Layout of Bundled Application

5

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted

Layout of Bundled Windows ApplicationMyAwesomeApp\ app\ MyAwesomeApp.cfg MyAwesomeApp.jar Packager.jar

MyAwesomeApp.exe packager.dll msvcr120.dll msvcp120.dll runtime\jre

6

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted

Layout of Bundled OS X ApplicationMyAwesomeApp.app/Contents Java/ MyAwesomeApp.cfg MyAwesomeApp.jar Packager.jar

MacOS/ MyAwesomeApp libpackager.dylib

Plugins/Java.jre

7

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted

Layout of Bundled Linux ApplicationMyAwesomeApp/ app/ MyAwesomeApp.cfg MyAwesomeApp.jar Packager.jar

MyAwesomeApp libpackager.so runtime/jre

8

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted

App Data• Mac ~/Library/Application Support/[app.preferences.id]/packager/jvmuserargs.cfg

• Windows C:\Users\[username]\AppData\Roaming\[app.preferences.id]\packager\jvmuserargs.cfg

• Linux ~/.local/[app.preferences.id]/packager/jvmuserargs.cfg

9

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted

Tricks• Some of these tricks are dependent on internal implementation or

are experimental features and are subject to change. They are not part of any API but they may be useful.

10

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted

Trick #1• Create a Simple DMG bundle • Mac DMG bundler automates Finder • -Bmac.dmg.simple=true

11

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted

Trick #2

12

• Bundle with all of Java SE • Example: javapackager -deploy --add-modules java.se …

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted

Trick #3• Convert high resolution PNG to Mac .icns • http://chrisbensen.blogspot.com/2015/12/convert-png-to-icns-for-mac-app-bundle.html

13

#!/bin/bash

INFILE=$1OUTFILE=$2

mkdir $OUTFILE.iconsetsips -z 16 16 $INFILE --out $OUTFILE.iconset/icon_16x16.pngsips -z 32 32 $INFILE --out $OUTFILE.iconset/icon_16x16@2x.pngsips -z 32 32 $INFILE --out $OUTFILE.iconset/icon_32x32.pngsips -z 64 64 $INFILE --out $OUTFILE.iconset/icon_32x32@2x.pngsips -z 128 128 $INFILE --out $OUTFILE.iconset/icon_128x128.pngsips -z 256 256 $INFILE --out $OUTFILE.iconset/icon_128x128@2x.pngsips -z 256 256 $INFILE --out $OUTFILE.iconset/icon_256x256.pngsips -z 512 512 $INFILE --out $OUTFILE.iconset/icon_256x256@2x.pngsips -z 512 512 $INFILE --out $OUTFILE.iconset/icon_512x512.pngcp $INFILE $OUTFILE.iconset/icon_512x512@2x.pngiconutil -c icns $OUTFILE.iconsetrm -R $OUTFILE.iconset

Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted 14

Mailing Lists:openjfx-dev@openjdk.java.nethttp://mail.openjdk.java.net/mailman/listinfo/openjfx-dev

Bug Reporting:

https://javafx-jira.kenai.comBlog

https://blogs.oracle.com/talkingjavadeployment/