Giter VIP home page Giter VIP logo

jar2app's Introduction

jar2app

jar2app is a Python 2/3 script that can easily convert any jar file into a Mac OS X app file. It seeks simplicity, and in fact can be run just like

jar2app input.jar

creating input.App in the process. No third-party libraries. No cruft.

Though simple and easy to use, there are loads of configurable options, such as setting icons, bundle names or bundling your own JRE/JDK.

Install instructions can be found here. Example usage can be found here.

It should run in any operating system (Windows, Mac OS X, Linux), but of course you'll only test the results in a Mac OS X system.

Table of Contents

(TOC created with the help of gh-md-toc)

Aren't there other tools that do this? Why another one?

There are other tools that do this. I acknowledge them and even have several links to them.

However, this project was born out of the need to do something easily and without much cruft. Most solutions out there require a gazillion arguments, or installing ant and memorizing lots of conventions. jar2app, however, tries to keep the power of those utilities while providing high simplicity in the process. Really, isn't it wonderful to have such an easy-to-use interface?

If you're also considering why these contributions weren't just sent to one of the other projects, it is because this could not be done easily. Packr uses a custom launcher and is meant to pack things for Mac OS X, Windows and Linux. Most of the other alternatives require third-party tools that embed other functionality and which simply cannot be stripped. The solution I was left with was just rolling out my own. If you think that's just a strong case of NIH, feel free to grab what you want from me and send a patch to the other projects :) Just follow the GPL!

Can I submit bundles created with jar2app to the Appstore?

jar2app may bundle your jar, but there are several steps you further need to take to submit your application to the Appstore. This is not a limitation of jar2app, it's just how the Appstore requires you to do things. For more information on how to submit bundles to the appstore, see here and here.

How do I install/uninstall it?

Just clone the repository and run install.sh, or uninstall.sh to remove it. It will install to /usr/bin, but you can change this by passing your desired prefix to install.sh, as an argument. This will install the jar2app application/script and make it available for you to run.

Examples:

Install

git clone https://github.com/Jorl17/jar2app
cd jar2app
chmod +x install.sh uninstall.sh
sudo ./install.sh

Install to /usr/local/bin prefix

git clone https://github.com/Jorl17/jar2app
cd jar2app
chmod +x install.sh uninstall.sh
sudo ./install.sh /usr/local/bin

Uninstall

./uninstall.sh

Uninstall from /usr/local/bin prefix

./uninstall.sh /usr/local/bin

How does it work?

jar2app relies on JavaAppLauncher (although you don't need to install anything). This application, officially provided by Oracle (previously Apple), acts as wrapper that starts a JVM with a set of options. The JVM can be bundled with the App file, or the system-wide-one can be used. Essentially, all that jar2app has to do is create a directory structure (app files are just directories), pack JavaAppLauncher and your application in it and set appropriate values in an Info.plist file. Additionally, if you so wish, your own JDK or JRE can be bundled and the Info.plist file will be updated to reflect this.

I know that there are other solutions that write their own wrapper, but the provided wrapper seems to work great (it's also bundled by Weka). The other wrapper I saw out there was from the Packr project and it really depended on their way of doing this.

What exactly can I change?

You can change many things, but more specifically, you can change the icon, the display name (the one that appears on the menu bar), the version and copyright information, the bundled JDK/JRE and the JVM options. For a full list of options, see here

Does jar2app bundle its own JRE/JDK? Can I bundle my own?

By default, jar2app doesn't bundle any JRE or JDK, and the default will be used on each system. You can, however, pass it a JRE/JDK with the -r,--runtime option. It can be supplied as a folder or as a zipfile. This JRE/JDK should match the directory structure found in Oracle's JDK (i.e. the first folder should be named Contents, etc).

Does jar2app figure the main class of my jar automatically? Can I change it?

Yes it does. It looks inside your jar file for the MANIFEST.MF file and extracts the name of the main class. You can change this behavior, and pass in another main class with the -m, --main-class option.

Apple defines several keys for its App format. How does jar2app figure them out?

There are several keys that Apple defines, and you might want to check them out. jar2app assigns values to the following keys:

  • CFBundleDevelopmentRegion: This is fixed at English
  • CFBundleExecutable: This is internally defined to JavaAppLauncher (from oracle)
  • CFBundleIconFile: This is set to whichever icon you passed in, and ignored if no icon is used
  • CFBundleIdentifier: This is chosen from the following, in order:
    1. What you supplied (-b,--bundle-identifier)
    2. The default: com.jar2app.example.application name
  • CFBundleDisplayName: This is chosen from the following, in order:
    1. What you supplied as display name (-d,--display-name)
    2. What you supplied as bundle name (-n,--name)
    3. The name of the app (passed as outputfile argument)
    4. The name of the jar (excluding extension)
  • CFBundleName: This is chosen from the following, in order:
    1. What you supplied as bundle name (-n,--name)
    2. What you supplied as display name (-d,--display-name)
    3. The name of the app (passed as outputfile argument)
    4. The name of the jar (excluding extension)
  • CFBundleVersion: This is chosen from the following, in order:
    1. What you supplied as version (-v,--version)
    2. What you supplied as short version (-s,--short-version)
    3. The default: 1.0.0
  • CFBundleShortVersionString: This is chosen from the following, in order:
    1. What you supplied as short version (-s,--short-version)
    2. What you supplied as version (-v,--version)
    3. The default: 1.0.0
  • CFBundleSignature: This is chosen from what you supply or the string "????".
  • NSHumanReadableCopyright: This is set to what you supply or the empty string

The info.plist file will contain additional keys, but there are used to pass information to JavaAppLauncher (JVM arguments, JDK/JRE, etc)

If I only pass the jar and no other options, what are the defaults used by jar2app?

jar2app assumes that you want to create an app file with the same basename as your jar file and in your current working directory. It assumes no JRE/JDK is to be bundled, and that no special arguments have to be passed to the JVM. The remaining options, such as the Icon, display name and others, are figured out as described in here. The short version is that all names get set to the basename of your jar, and that versions are set to 1.0.0.

How is the App name determined?

You are probably also interested in this question and this question. The app name is determined as so:

  1. What you supplied as app name (it is the last unnamed argument, e.g. jar2app in.jar outname). You don't need to append .App, as jar2app does it for you.
  2. What you supplied as bundle name (-n,--name)
  3. What you supplied as display name (-d,--display-name)
  4. The name of the jar (excluding extension)

Where did this idea come from?

Well, you should probably check this FAQ entry first. I originally went looking for an application like jar2app because I noticed that spotlight didn't like showing me .jar files. This meant that whenever I wanted to launch applications bundled as jars (and that happens very often), I'd have to break my workflow and wait while spotlight figured itself out. To fix this, I decided to just package the jar in an app. "It must be easy, right"? Turns out it wasn't so easy and most tools weren't straightforward, so, here's jar2app. Have fun, report bugs and add features as you wish!

Is there a GUI?

This tool is so simple to use that it seems pointless to add a GUI. Nevertheless, for all your command line aversion needs, I might implement a really simple optional GUI in the future (probably using PyQt).

Does it work on retina screens?

Yes it does. It adds specific entries in the Info.plist file to ensure that retina screen is enabled by default. You can change that by passing -l,--low-res-mode.

Should I use jar2app for my commercial application?

You can, but don't expect a one-liner to do the trick. There are several parameters that you have to configure, including special unique keys and signatures. jar2app has many defaults that should not be used if you intend to distribute your application in very serious fashion. Use it with the default values for simple, easy and straightforward redistribution.

jar2app doesn't do what I want. Are there other alternatives?

jar2app tries to do most of what the other tools do. It's lacking mostly in JRE/JDK minimizing support, and it hasn't really been thoroughly tested when bundling things for the app store.

If it's not your cup of tea, don't worry! There are other alternatives, such as the wonderful Packr, the official Oracle documentation, the official Apple documentation and the AppBundler project, part of which is used in jar2app. You can also read more about the cumbersome nature of packaging jars in app files here.

Even if jar2app didn't help, come back and open an issue, or send your own patches!

Example Usage

Here are a couple of examples on how to change the settings of jar2app. For a full list of options, see here.

Easiest way to bundle

jar2app test.jar

You should now have a test.App in your directory.

Changing App file output name

This can be done in several ways. The most straightforward one is just:

jar2app test.jar out

You should now have a out.App in your directory. Note how jar2app automatically appends the .App extension (this can be disabled with -a,--no-append-app-to-name). You can also do

jar2app test.jar out.App

Lastly, You can also do

jar2app test.jar test/out.App

And jar2app will create the test subdirectory for you. It only creates the parent directory of the target .app file, though!

Also note that the app output name is pre-determined based on other options. For instance, if you pass in a bundle name, that will be used. See this question for more details.

Bundle with an icon

jar2app test.jar -i icon.icns

You should now have a test.App in your directory with the provided icon. -i can be a full path, e.g.

jar2app test.jar -i /awesomeicons/icon.icns

Changing the name that appears in menu bars (Bundle Display Name)

The name that appears in menu bars will be given by the Bundle Display Name. You can se this with -d,--display-name, but I'd really recommend that you change the bundle name itself with -n,--name (the Bundle Display Name will assume this value). This can be done with

jar2app test.jar -n "Amazing Application"

Note that since in the above example, no output .App name is given, the .App file will also be named "Amazing Application" (see here). You can change this by doing any of:

jar2app test.jar out -n "Amazing Application"
jar2app test.jar out.app -n "Amazing Application"
jar2app test.jar -n "Amazing Application" out
jar2app test.jar -n "Amazing Application" out.app

Any of those commands will have the same effect: the app file will be out.app, but the display name (shown in menus) will be "Amazing Application".

Bundling your own JDK/JRE

Say you want to bundle your own JDK/JRE. For instance, assume you want to bundle the one located at /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk. This is trivial to do (-r, --runtime), just run:

jar2app test.jar -r /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk

You can also pass the JDK/JRE as a zip file. Assume you have it in compressed form in /compressedJDKs/jdk1.8.0_40.jdk.zip, just do:

jar2app test.jar -r /compressedJDKs/jdk1.8.0_40.jdk.zip   

What are all the options?

  -h, --help            show this help message and exit
  -n BUNDLE_NAME, --name=BUNDLE_NAME
                        Package/Bundle name.
  -d BUNDLE_DISPLAYNAME, --display-name=BUNDLE_DISPLAYNAME
                        Package/Bundle display name.
  -i ICON, --icon=ICON  Icon (in .icns format). (Default: None)
  -b BUNDLE_IDENTIFIER, --bundle-identifier=BUNDLE_IDENTIFIER
                        Package/Bundle identifier (e.g. com.example.test)
                        (Default is application name prefix by
                        com.jar2app.example..
  -v BUNDLE_VERSION, --version=BUNDLE_VERSION
                        Package/Bundle version (e.g. 1.0.0) (Default: 1.0.0).
  -s SHORT_VERSION_STRING, --short-version=SHORT_VERSION_STRING
                        Package/Bundle short version (see Apple's
                        documentation on CFBundleShortVersionString) (Default:
                        1.0.0).
  -c COPYRIGHT_STR, --copyright=COPYRIGHT_STR
                        Package/Bundle copyright string (e.g. (c) 2015 Awesome
                        Person) (Default: empty)
  -u SIGNATURE, --unique-signature=SIGNATURE
                        4 Byte unique signature of your application (Default:
                        ????)
  -m MAIN_CLASS_NAME, --main-class=MAIN_CLASS_NAME
                        Jar main class. Blank for auto-detection (usually
                        right).
  -r JDK, --runtime=JDK
                        JRE/JDK runtime to bundle. Can be a folder or a zip
                        file. If none is given, the default on the system is
                        used (default: None)
  -j JVM_OPTIONS, --jvm-options=JVM_OPTIONS
                        JVM options. Place one by one, separated by spaces,
                        inside inverted commas (e.g. -o "-Xmx1024M -Xms256M)
                        (Default: None)
  -a, --no-append-app-to-name
                        Do not try to append .app to the output file by
                        default.
  -l, --low-res-mode    Do not try to report retina-screen capabilities (use
                        low resolution mode; by default high resolution mode
                        is used).
  -o, --use-osx-menubar
                        Use OSX menu bar instead of Java menu bar (Default:
                        False).
  -e EXECUTABLE, --executable-name=EXECUTABLE
                        Name of the internal executable to launch (Default:
                        JavaAppLauncher).
  -x EXECUTABLE_FILE, --executable-file=EXECUTABLE_FILE
                        Internal executable to launch. By default,
                        JavaAppLauncher provided by jar2app is used.
  -w WORKING_DIRECTORY, --working-directory=WORKING_DIRECTORY
                        Set current working directory (user.dir) on launch
                        (Default: $APP_ROOT/Contents).

jar2app's People

Contributors

akbcode avatar berry120 avatar jorl17 avatar lhaeger avatar lucina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jar2app's Issues

Use macOS menu bar

Hello,

I like to have the macOS menu bar to be used instead of the Java menu bars.
For example, the menu bar of Umlet shown as a native macOS menu bar.

I used to do this with XCode's Jar Bundler, using the option "Use Macintosh menu Bar". This worked fine, but Jar Bundler is now discontinued.

There seems also a command line flag for achieving it.

Regards,
Max

Permission not granted

I have converted my file named myfile.jar, it works and becomes myfile.app. Unfortunately, when I open in my Mac (Big Sur 11.2) got an error. it says that I don't have permission ("You do not have permission to open the application "myfile". "). I know that I can solve this by changing its file permission by chmod 777, but I don't want anyone that I give my app, he/she doing the same thing, he/she will think it too complicated. So, can "jar2app" convert it and automatically give the permission to all?
thanks

Package Multiple jar's in one App

For our project we package a Slim jar and then included all our dependency's as jar's as well.

Is it possible to add an option to package multiple jars, so in the Java directory instead of just having our one excitable jar we also want to package multiple other jar's that we depend on?

Commandline args not passed on to mac os JavaAppLauncher

I have packaged a java app for mac os but when I try to call the app with cmdlines (either via open command or by going directly into the app macos folder and running JavaAppLauncher with arguments) they are not forwarded to the java main method...
Doing via java -jar goldfinder.jar arg1 arg2
works.
Any Clue how to get this working? Is it a configuration issue or a feature?

How to package extra files into app

Directory Structure:
xxxx.jar data.db
Java code:
jdbc:sqlite:data.db
Run jar need data.db
Usejar2app XXXX.jar -j "-XstartOnFirstThread" -r /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk
Open app prompt error
not found data.db

Add additional dependencies

Looking at How to package extra files into app I see that the solution was to manually copy the desired file into the Contents directory. I would like to propose an additional terminal option to add a library folder.

Ex: jar2app XXXX.jar --additional-libs=/path/to/library/

The reason being is that there are occasionally JARs that have an external lib folder that is required for the JAR's execution such as MSGViewer. It makes sense to have it packaged along with it as a standard approach instead of extra steps seeing as it's necessary for core operation rather than an extraneous bit of data to be used by the JAR.

If you like the idea, I'll try to find some spare time to fork this repo and add it in myself.

Edit: Since this is for libraries/files to be used as dependencies for the JAR being added and the JAR usually looks in the CWD, the additions would go in the XXXX.app/Contents/Java/ folder rather than simply XXXX.app/Contents/ as it was done in the aforementioned issue.

App doesnt launch on MacOS with JDK11

As of recently Oracle has forced MacOS users to download JDK11 and not anymore 10.0.2, which is troublesome as the app created by jar2app (exactly the JavaAppLauncher) fails with JDK11 installed

Any update on whether JDK11 is on the roadmap to be supported?

JavaFX Launcher warning

When I start the new-made app, a warning comes up: This application requires a newer version of the Java runtime.
JavaFX Launcher 2020-01-20 14-48-22
What should I do?

Operation not permitted?

I thought I'd give your program a try, but the install script doesn't appear to want to work. Here's what I've tried and their output:

apaches-iMac:Development apache$ git clone https://github.com/Jorl17/jar2app
Cloning into 'jar2app'...
remote: Counting objects: 62, done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 62 (delta 30), reused 62 (delta 30), pack-reused 0
Unpacking objects: 100% (62/62), done.
Checking connectivity... done.
apaches-iMac:Development apache$ cd jar2app
apaches-iMac:jar2app apache$ ls
LICENSE         install.sh      jar2app_basefiles
LICENSING       jar2app         uninstall.sh
README.md       jar2app.py
apaches-iMac:jar2app apache$ chmod +x install.sh uninstall.sh
apaches-iMac:jar2app apache$ sudo ./install.sh
Password:
mkdir: /usr/bin/jar2app_basefiles: Operation not permitted
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
       cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory
cp: /usr/bin/jar2app: Operation not permitted
chmod: /usr/bin/jar2app: No such file or directory

Those last few lines are the problem. I don't know what's going on. Any ideas?

Running Mac OS X El Capitan (10.11.6).

Not an issue, but a how-to for signing and notarization

Okay, here is what I did to successfully sign a bundled .jar. You need to

  • change the linked SDK of JavaAppLauncher, since this is too old (macOS 10.7, but we need 10.9)
  • use entitlements so that a bundled JRE can be started

First we need to change the provided binary of JavaAppLauncher:
xcrun vtool -set-version-min macos 10.9 10.9 -replace -output JavaAppLauncher.new path/to/original/JavaAppLauncher

This vtool command is provided with Xcode and sets the linked SDK version to 10.9, which is needed for code signing.
Don't forget to exchange the JavaAppLauncher binaries, so that the modified one is used when bundling your .jar.
Now sign the app with
codesign --options runtime --entitlements entilement.plist --force --sign "Developer ID Application: Your_Name" path/to/your/bundle.app

For the entitlements you should use (save that to entilement.plist):

 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
   <dict>
     <key>com.apple.security.cs.disable-library-validation</key><true/>
     <key>com.apple.security.cs.disable-executable-page-protection</key><true/>
    </dict>
 </plist>

With this, I managed to get an app signed and notarized (as part of a DMG), which is able to run on Intel and Apple Silicon Macs with macOS 10.9 or higher.

I use bundle jdk created by jlink, codesign failed

# craete app
jar2app my.jar -r jdk/ -b me.wener.tools -d my -i ./my.icns -j '-Xmx64M'

# codesign
codesign -s "iPhone Developer: xxx" --force --deep --verbose my.app
my.app: bundle format unrecognized, invalid, or unsuitable
In subcomponent: /Users/wener/my.app/Contents/PlugIns/jdk/Contents/Home/jre/legal/java.xml

uploading to app store

I've hit a wall trying to upload apps created by jar2app to the app store. The complaint (from transporter) is that
it can't find the bundle id.
https://stackoverflow.com/questions/59761535/error-from-transporter-failed-to-get-the-apps-bundle-id

My hope, entering this as an issue for jar2app, is that it's some subtle and otherwise meaningless feature
of the app written by jar2app that is confusing transporter.

Here is the script I use to create the app, and bundle it for transporter.
#!/bin/csh
./jar2app boardspace.jar -i boardspace.icns -n "boardspace" -d "boardspace.net" -b "com.boardspace.app.launcher" -v 1.0
codesign -s "Developer ID" boardspace.app/Contents/MacOS/JavaAppLauncher
codesign -s "Developer ID" boardspace.app/Contents/Resources/boardspace.icns
codesign -s "Developer ID" boardspace.app/Contents/Java/boardspace.jar
codesign -s "Developer ID" boardspace.app

productbuild --component boardspace.app /applications --sign "Developer ID" --identifier com.boardspace.launcher.app boardspace.pkg

unable to load runtime environment

I have been trying to figure out how to get around this error when your using your app. I am able to get it to output the jar but receive an error when attempting to run it. I have also signed the application as well to only have it result in the same error.

Can get the app to run with a bundled JRE.

I am running:
jar2app -r jre1.8.0_221.jre -n TechnicLauncher -d TechnicLauncher -i Icons.icns -b com.amobiledevice.TechnicLauncher TechnicLauncher.jar
Where jre1.8.0_221.jre was extracted from jre-8u221-macosx-x64.tar.gz downloaded from Oracle. I have also tried:
jar2app -r "/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk" -n TechnicLauncher -d TechnicLauncher -i Icons.icns -b com.amobiledevice.TechnicLauncher TechnicLauncher.jar
Both produce the same error:
Screen Shot 2019-08-17 at 5 11 00 AM
Running the command without the -r option works fine, but as soon as I try to bundle a java runtime it breaks.

getting error when attempting to package file

jar2app UserProxy.jar test -r jre1.8.0_111.jre/
Packing UserProxy.jar into /Users/macmini/Desktop/shit to sign/jartest/test.app
Traceback (most recent call last):
File "/usr/local/bin/jar2app", line 487, in
main()
File "/usr/local/bin/jar2app", line 485, in main
make_app(*parse_input())
File "/usr/local/bin/jar2app", line 434, in make_app
copy_base_files(app_full_path, icon, jar_file, jdk, jdk_isfile)
File "/usr/local/bin/jar2app", line 300, in copy_base_files
copy_jdk(app_full_path, jdk, jdk_isfile)
File "/usr/local/bin/jar2app", line 275, in copy_jdk
shutil.copytree(jdk, os.path.join(app_full_path, 'Contents', 'PlugIns', os.path.basename(jdk)))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 177, in copytree
os.makedirs(dst)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 17] File exists: './test.app/Contents/PlugIns/'

Error when running jar2app

Mac Mini M1
macOS 13.3.1 Ventura
python 3.9.6

I've installed jar2app in /usr/local/bin

When I issue the command jar2app convertwithmoss-6.2.0.jar, i get the error message env: python: Not a directory

I looked at #56, and issued the command ln -s -f /usr/local/bin/python3 /usr/local/bin/python and then tried the jar2app comand again with the same result.

Xbootclasspath command is not supported

java -noverify -Xbootclasspath/p:load.jar -jar work.jar is work
try to use jar2app work.jar -j "-noverify -Xbootclasspath/p:load.jar",move load.jar to work.app/Contents ,but it doesn't seem to work.
try to use -m "load.jar", move load.jar to work.app/Contents,get error:not found load.jar.

"unable to load java runtime environment"

I've jumped through most of the hoops to get my app into the apple app store; it works
fine if java is installed and jar2app doesn't specify a jvm. However, it seems unlikely that
apple will accept this. If I add a jvm with the -j, the .app no longer launches with the
quoted.
"unable to load java runtime environment"

I see traffic in other threads about the same problem, but no clear solutions.

how is the jar launched

I see that in the Macos folder is a javalauncher file. how is that used to launch the package jar? I also codesigned the resulting .app but still seem to have issues with gatekeeper not allowing the app to launch

Termination Reason: Namespace CODESIGNING, Code 0x1

SplashScreen in MANIFEST.MF not working

So, I have an image in my jar file called loading.gif. In my manifest file, there is an attribute: SplashScreen-Image: loading.gif

This works perfectly fine as a .jar file, but upon using jar2app, it stops working for some reason.

Distribution on Homebrew

Hey, any reason for not distributing on Homebrew?
If you like I can create the formula for it quite easily and submit it to be included, just need a release (part of their policy is not to accept anything HEAD-only, so need a github release) it would be awesome to add it to homebrew as thats where I and I am sure many other look for things on macos first, and it makes for simple, unified package management.

Scoop manifest

If you fancy installing jar2app using scoop, here's a manifest to to so: jar2app.json.zip
Just unzip it and run scoop install jar2app.json. If python is not installed it will be downloaded and installed in the process

Note: this will install the latest version from the master branch. Since there is no versioning scheme, autoupdate is not possible; however you should be able to force an update using scoop update jar2app -f.

Maybe it would be a good idea to submit a pull request to scoop's repo to have it included in the main bucket.

Adding icon using -i parameter does not change the icon of the .app application

jar2app doesn't change the displayed icon shown in finder. The only way I've found that this can be done is to open the icon in preview copy and paste it into the Get Info top left icon area of the application. Can this be fixed so this step is not needed.

Example Usage:
$ jar2app myapp.jar -n "MyApp" -i "myappicon.icns"
MyApp.app shows a script icon and not the icon chosen in the command.

This was done with Mac OS Verison: macOS Mojave version 10.14.2

Not even including my own JRE, but still getting "Unable to load Java Runtime Environment" error

I created my own calculator using javaFX and of course java, and I wanted to create an application that I can run instead of the given apple one because I thought it would be funny and (somewhat) cool. I have gotten to the point where I have a jar file; however, I am not able to simply run "java -jar filename.jar". To get it to run on the command line I need to run a much longer command "java --module-path /Users/zbmach/Java/Extensions/javafx-sdk-11.0.2/lib --add-modules javafx.controls,javafx.fxml -jar Calculator-1.0-SNAPSHOT.jar". I assumed that the part starting at --module-path and ending right before the -jar are the jvm options. Because of this I input "jar2app Calculator-1.0-SNAPSHOT.jar -n "Calculator 2" -i Calculator.icns -j "--module-path /Users/zbmach/Java/Extensions/javafx-sdk-11.0.2/lib --add-modules javafx.controls,javafx.fxml" -r "/Library/Java/JavaVirtualMachines/jdk-15.0.1.jdk/Contents/Home"". I would love if someone could help me figure out what I need to change when creating the app to eliminate the error I am getting!

Operation not permitted copying Localizable strings

I get the following error message when bundling my jar:

OSError: [Errno 1] Operation not permitted: './Magikcraft.app/Contents/Resources/en.lproj/Localizable.strings'

There is a ./Magikcraft.app/Contents/Resources folder in the output, but no en.lproj one.

jar packaging gatekeeper

how is the jar packaged and when it is, is it in conformance with gatekeeper on osx 10.12.1? I have been able to codesign this without problem but when attempting to launch or verifying with spctl it says it is rejected.

Not working when using Binary files as storage in application

In my project, I have 2 Binary files that must go on the same level as the .jar file. As without them, the .jar file will not execute. To fix this I moved the .bin files into the java folder, so the .jar file will run however the .app will still not run. Does something need to be changed in the info.plist?

problems building MSGViewer-1.9 - not including additonal Libraries with root jar

https://sourceforge.net/projects/msgviewer/ creates an additional subdirectory, lib/ at the same level as the application jar with additional jar library files and I do not see a way to make a reference or include this structure when rolling up the wrapper .app structure.

[ <user@machine>:~/Desktop/MSGViewer-1.9 08:34 ]$  jar2app MSGViewer.jar
jar2app 1.0.1, João Ricardo Lourenço, 2015-2017 <[email protected]>.
Github page: https://github.com/Jorl17/jar2app/
Packing MSGViewer.jar into ~/Desktop/MSGViewer-1.9/MSGViewer.app
CFBundleIdentifier: com.jar2app.example.MSGViewer
CFBundleDisplayName: MSGViewer
CFBundleName: MSGViewer
CFBundleShortVersionString: 1.0.1
CFBundleSignature: ????
CFBundleVersion: 1.0.1
Retina support enabled.
---
JVMMainClassName: net.sourceforge.MSGViewer.ModuleLauncher
Executable Name (CFBundleExecutable): JavaAppLauncher
JAR Working directory: $APP_ROOT/Contents

MSGViewer.jar packaged to ~/Desktop/MSGViewer-1.9/MSGViewer.app

Fails to run. Rightly so, missing additional libraries. Moving the lib/* files into a MSGViewer.app/Contents/Java/lib subdirectory fixed the issue, but you don't have an include option additional dir's or files in the build process nor documentation to move things around.

This program is great by the way. Simple and to the point. Hope this improvement or documentation can be worked in.

Jar2exe add on

As the title says, could you add exe exporting functionality from jar2app but one that works in converting to an exe application? That would be amazing! (It is just a feature request.)

Native specific lib folder addition

Hello,

is it possible to add a folder that contains native libs?
For example I have a vm option for loading the files:
-Djava.library.path=.../nativeLibs/something.framework

Is it possible to add this nativeLibs folder to the app config to be able to use it correctly?
Does this make sense?

Thanks!

Package jar without jdk

Simply put, is there a way to not have the jdk added in the plugins folder? I do not need it, and I cannot disable it.

Just a question :-)

This is not really an issue.

You know that Gentoo is considered by many to be the most powerful distribution of GNU/Linux. In Gentoo, you compile every program from source, rather than using the distribution maintainers' precompiled binaries. This means that every program is specially tailored to your system and needs and is better optimized.

Why did you switch from Gentoo GNU/Linux to Mac OS ? What made you change your mind?

jar to app with args

I would like to pack a java application with script
my script starts with java -jar myapp.jar file.txt
to convert it to macos
I converted my jar with your tools but the problem when I run
open -n myapp.app file.txt the program does not see the arguments?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.