tips, tricks, and hidden knowledge of java packager · tricks • some of these tricks are...

16

Upload: trinhdung

Post on 04-Jun-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Tips, Tricks, and Hidden Knowledge of Java Packager · Tricks • Some of these tricks are dependent on internal implementation or ... Copyright © 2016, Oracle and/or its affiliates
Page 2: Tips, Tricks, and Hidden Knowledge of Java Packager · Tricks • Some of these tricks are dependent on internal implementation or ... Copyright © 2016, Oracle and/or its affiliates
Page 3: Tips, Tricks, and Hidden Knowledge of Java Packager · Tricks • Some of these tricks are dependent on internal implementation or ... Copyright © 2016, Oracle and/or its affiliates

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

Page 4: Tips, Tricks, and Hidden Knowledge of Java Packager · Tricks • Some of these tricks are dependent on internal implementation or ... Copyright © 2016, Oracle and/or its affiliates

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

Page 5: Tips, Tricks, and Hidden Knowledge of Java Packager · Tricks • Some of these tricks are dependent on internal implementation or ... Copyright © 2016, Oracle and/or its affiliates

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

Layout of Bundled Application

5

Page 6: Tips, Tricks, and Hidden Knowledge of Java Packager · Tricks • Some of these tricks are dependent on internal implementation or ... Copyright © 2016, Oracle and/or its affiliates

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

Page 7: Tips, Tricks, and Hidden Knowledge of Java Packager · Tricks • Some of these tricks are dependent on internal implementation or ... Copyright © 2016, Oracle and/or its affiliates

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

Page 8: Tips, Tricks, and Hidden Knowledge of Java Packager · Tricks • Some of these tricks are dependent on internal implementation or ... Copyright © 2016, Oracle and/or its affiliates

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

Page 9: Tips, Tricks, and Hidden Knowledge of Java Packager · Tricks • Some of these tricks are dependent on internal implementation or ... Copyright © 2016, Oracle and/or its affiliates

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

Page 10: Tips, Tricks, and Hidden Knowledge of Java Packager · Tricks • Some of these tricks are dependent on internal implementation or ... Copyright © 2016, Oracle and/or its affiliates

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

Page 11: Tips, Tricks, and Hidden Knowledge of Java Packager · Tricks • Some of these tricks are dependent on internal implementation or ... Copyright © 2016, Oracle and/or its affiliates

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

Page 12: Tips, Tricks, and Hidden Knowledge of Java Packager · Tricks • Some of these tricks are dependent on internal implementation or ... Copyright © 2016, Oracle and/or its affiliates

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 …

Page 13: Tips, Tricks, and Hidden Knowledge of Java Packager · Tricks • Some of these tricks are dependent on internal implementation or ... Copyright © 2016, Oracle and/or its affiliates

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/[email protected] -z 32 32 $INFILE --out $OUTFILE.iconset/icon_32x32.pngsips -z 64 64 $INFILE --out $OUTFILE.iconset/[email protected] -z 128 128 $INFILE --out $OUTFILE.iconset/icon_128x128.pngsips -z 256 256 $INFILE --out $OUTFILE.iconset/[email protected] -z 256 256 $INFILE --out $OUTFILE.iconset/icon_256x256.pngsips -z 512 512 $INFILE --out $OUTFILE.iconset/[email protected] -z 512 512 $INFILE --out $OUTFILE.iconset/icon_512x512.pngcp $INFILE $OUTFILE.iconset/[email protected] -c icns $OUTFILE.iconsetrm -R $OUTFILE.iconset

Page 14: Tips, Tricks, and Hidden Knowledge of Java Packager · Tricks • Some of these tricks are dependent on internal implementation or ... Copyright © 2016, Oracle and/or its affiliates

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

Mailing Lists:[email protected]://mail.openjdk.java.net/mailman/listinfo/openjfx-dev

Bug Reporting:

https://javafx-jira.kenai.comBlog

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

Page 15: Tips, Tricks, and Hidden Knowledge of Java Packager · Tricks • Some of these tricks are dependent on internal implementation or ... Copyright © 2016, Oracle and/or its affiliates
Page 16: Tips, Tricks, and Hidden Knowledge of Java Packager · Tricks • Some of these tricks are dependent on internal implementation or ... Copyright © 2016, Oracle and/or its affiliates