Git Product home page Git Product logo

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

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

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.

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?

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.

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?

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?

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.

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.

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

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

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!

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.

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?

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.

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.

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?

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

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

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.

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.

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.

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

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!

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

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

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.

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

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?

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.

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

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

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.

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.