Jar launcher mac os
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Cross-platform native Java launcher
Native executable launcher, starts JAR applications using relative (to launcher executable) paths to JRE and JAR file. Paths are compiled into launcher. Works on Linux, Mac OS X and Windows.
Note: this is not an executable wrapper, for JAR wrapping you may use launch4j (or others like it) instead
To compile launcher you will need:
- bash-like shell
- GNU make
- C99 compiler
On windows you may use msysGit bash as shell and mingw-w64 compiler with patched version of make (description).
To build launcher with paths, specific for your application, you must prepare environment file, example:
Build on windows using custom icon and version info
Icon file path, version information (author, company etc) and manifest file are specified in resources/resources.rc file. To use custom parameters, copy resources.rc to myapp.rc , edit it approproately and set this variable in env file:
This project is released under the Apache License 2.0
2012-12-06
- fix «This program might not have installed correctly» message on windows7, issue1
Question: Q: Running a java jar program from OS x
Because it is easy to develop java programs on a Mac using the IDE Eclipse that is how I do it. My customers run the programs on a PC under Windows by clicking on a shortcut that points to a .cmd file containing the code:
cd \buildresume
java -cp BuildResume.jar menu.Menu
To execute the jar file on the Mac, I run it in Eclipse or go to terminal and type in:
java -cp BuildResume.jar menu.Menu
How can I run it as an application in OS X without going to Terminal?
Intel Mac Mini, Mac OS X (10.6.3)
Posted on Apr 26, 2010 5:39 PM
All replies
Loading page content
Page content loaded
Apr 26, 2010 6:09 PM
Apr 26, 2010 9:29 PM
Here is what I have found out so far:
1. Click once on the .jar file in the Finder.
2. From the menubar in the Finder select File -> Get Info».
3 Click on «Open with» and from the popup menu.
4. Select «Jar Launcher», which is built into OS X.
5. Whenever you double click on the .jar file the program will start.
The only questions I have left are:
1. How did the parameter menu.Menu get passed to the execution module?
2. Where is the documentation on how to use «Jar Launcher»?
Thanks for your help.
Apr 27, 2010 5:53 AM
I have found an even easier way of solving the problem. There is a program called Jar Bundler in /Macintosh HD/usr/share/java/tools/jar Bundler. usr is a hidden directory. I had to do a ‘find’ on ‘jar Bundler’ then double click the folder icon that cam up and just built the program icon to execute BuildResume.jar menu.Menu. All works well.
Apple has some great tools if you can just find them.
Apr 27, 2010 9:31 AM
Question: Q: Running a java jar program from OS x More Less
Java jar launcher for console only apps mac
I want to bundle my .jar app to automatically run open on mac os. It has no GUI so it needs to be run from terminal to work but I need to give it to others who would rather not use terminal. How would I go about doing this? I tried the app builder that is seen here but it only shows up on activity monitor for a fraction of a second before going away. More info about my jar file: It was build in netbeans so it does have all the folders/xml needed to build a jar via ant. It needs a few additional libraries that are copied to the lib folder when netbeans builds the project. Thirdly it needs to store temp files in a folder called assets that is located in the same folder as the jar file is. I can change number 3 if need be.
1 Answer 1
Your issue doesn’t really have much to do with running on the mac — the problem is that you’re trying to run a console app without a console.
Here is an example of one way to provide a console in a GUI window, rather than running the app in an shell (the terminal).
Once you have that working, you can consider wrapping it in the Mac — specific deployment that you pointed to.
For portability’s sake, you may also want to consider:
Re-packaging your classes and all of the classes from your jar dependencies into one big «uber-jar» — there are several tools for doing this, including the Maven Assembly Plugin
Jar launcher mac os
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Launcher for bundled java applications on Mac OS
Backup original Info.plist to Info.plist.original
Copy launcher script to AppBundle.app/Contents/MacOS/mac-java-launcher
Remove «Java» (or «JVMOptions») section from Info.plist
Set «CFBundleExecutable» in Info.plist to mac-java-launcher
Set «JVMVersion» in Info.plist.original to 1.6+
Also, it is easy to restore original launcher:
This command will revert previous one. «—java-version» is optional in both cases, however «—undo» doesn’t revert java version change by itself.
Changing Only the JDK Version
Many newer .app bundles do not require the launcher script to work, such as IntelliJ IDEA 13.x . However, these applications may still require an earlier version of Java to be installed (e.g., JDK 1.6).
In such cases, the Info.plist needs to have its JVMVersion updated. IntelliJ IDEA 13.x has a value of 1.6* , which requires a release of JDK 1.6 to be installed. However, changing it to 1.6+ allows it to work with JDK 1.6 and newer.
- Change the JVMVersion to 1.6+ from the default 1.6* and allow IntelliJ IDEA 13 to work JDK 1.6, JDK 1.7, or JDK 1.8.
Mac OS launcher for bundled java applications requires JDK 1.6 to be installed. And even if application itself requires only JDK 1.7 you will still need to install JDK 1.6 — just to satisfy the application launcher. You can see this issue, for example, with IntelliJ IDEA or yEd after changing «JVMVersion» in Info.plist to 1.6+ (not the case for newer releases of IDEA).
If you would like to require a specific JDK release, such as JDK 1.7, then you can change the value to 1.7* . If you would like to allow for any release after a specific release, such as JDK 1.7, then you can specify the value with a + —like 1.7+ —to allow any JDK to be used starting with that relase and up (e.g., JDK 1.8 would also work).
mac-java-launcher replaces the default launcher shipped with the application and mac-java-launcher requires no JDK by itself (it will replace launcher only for single application specified in command line argument). After that, only the JDK version actually required by application must be installed.
mac-java-launcher uses the «Java» section from Info.plist.original when launching application. If you want, for example, change «JVMVersion» from 1.6* to 1.6+ you can do it in Info.plist.original . Also, that can be done with «—java-version» option.
About
Launcher for bundled java application on Mac OS
Question: Q: Cannot launch JAR file in Mac OS X 10.14.3 (Mojave)
I’m running an iMacPro running Mac OS X ver. 10.14.3 (Mojave). When I attempt to start a JAR file, all I get is an error message that I can’t. All my software appears to be up-to-date.
[Personal Information Edited by Host]iMac Pro, macOS 10.14
Posted on Mar 20, 2019 8:43 PM
All replies
Loading page content
Page content loaded
Orbital, in order to run a jar file in Mojave, you need to have some implementation of Java installed. Apple deprecated Java 6 years ago. As a result, it is now necessary to install Oracle’s java implementation. You can download the latest version here:
After you have run the installer package, you can verify that it is the active Java installation by typing the following in the Terminal and hitting your return key:
Please let me know if this resolves your issue. Thanks!
Mar 20, 2019 8:54 PM
I installed Java SE 12 before posting my question, and it did not work.
Mar 20, 2019 9:59 PM
Java — Apple — Support
Mar 20, 2019 10:05 PM
Can you please clarify your comment? Are you saying that you were unable to install Java, or that even though you successfully installed it, you still couldn’t get the jar file to run? Also, is it possible that the jar file requires legacy Java, such as Java 6? As you may know, even with the latest and the greatest from Oracle installed, some older Java-dependent apps will not work, because they require Java 6, which you can download here, if needed:
Mar 20, 2019 10:04 PM
Again, my Java SDK is up to date. I made sure it was up to date before I posted my question to the community. I also installed javaforosx and still I cannot start the JAR file.
Using “Jar Launcher” on High Sierra how do I pass command line arguments to a java app (jar)
Is it possible to use «Jar Launcher» on Mac to pass command line arguments to a java app? For example:
open myApp.jar —args -hello
This ought to run myApp and pass it «-hello» but it doesn’t.
I’m on High Sierra 10.13.6. This comes with a «Jar Launcher». It’s /System/Libary/CoreServices/Jar\ Launcher.app.
I can run the jar file with Jar Launcher, I did it from Finder and it works, but without command line arguments. After that I can run a command line «open myApp.jar» and that works too, the open command uses Jar Launcher to open it. So far so good.
Now I want to pass arguments, let’s say «-hello»
I tried «open myApp.jar —args -hello». That does not work, the application does not receive the hello argument.
I can’t figure out how to do this. Maybe the problem is with «Jar Launcher», maybe it won’t pass arguments through to the java app?
I know this can be done by installing a full JDK and using the java command instead of the built-in Jar Launcher, or compiling my jar into a Mac executable. I’m not a developer, I’d like to know if I can achieve this just using what’s shipped on my Mac.
Earlier versions of MacOs shipped with a more complete Java environment, and a lot of the help I find out there refers to earlier versions.