Comments (16)
I don't know if this actually helps the issue, but one solution would be to create an extremely simple application in Automator that runs shell script java -jar "$@"
when fed a jar file.
You can then just use Get Info on any given jar to set this app as the default for opening jar files (the only side-effect of this is that the icons on jar files themselves will change, but if you don't mind that, this is a pretty good solution).
Here's a screenshot of the actual project in Automator:
EDIT: If you don't want this file to just clutter up your Desktop or anything, you can place it in ~/Library/Services/, as that is typically where Automator apps go.
from installer.
@todivefor any idea how this would be associated?
from installer.
So I've created a .jar file on my mac and when I double click it, it opens with jar launcher app. That seems to be working for me.
from installer.
Or is this to do with making jar launcher.app use adoptopenjdk Java rather than another vendor?
from installer.
running a test build with this fix: #95
from installer.
@todivefor could you please confirm the fix for me by running the following commands making sure that the INPUT_DIRECTORY variable is set correctly:
INPUT_DIRECTORY=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk
/usr/libexec/PlistBuddy -c "Add :JavaVM:JVMCapabilities:1 string JNI" "${INPUT_DIRECTORY}/Contents/Info.plist"
/usr/libexec/PlistBuddy -c "Add :JavaVM:JVMCapabilities:2 string BundledApp" "${INPUT_DIRECTORY}/Contents/Info.plist"
from installer.
@gdams that did not work. I first tried it just like you said and it seemed to work. I then tried it on INPUT_DIRECTORY=/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk and it did not work there. I went back to adoptopenjdk-8.jdk and removed the above fix and re-tryed. It worked, so my statement all AdoptOpenJDK releases was false. Double click on 1.8.0_192-b12 works, but 11.0.3+7 does not.
from installer.
hmmm okay, do you know if an Oracle Java 11 works with this?
from installer.
I do not, but I can give it a try.
from installer.
I tried this on Oracle Java 11, and the bottom line is it operates the same as AdoptOpenJDK 11 (cannot double click jar). I can get both Oracle 11 and AdoptOpenJDK 11 to work if within Netbeans if I have Java Platform set to JDK 11 and Source/Binary Format set to JDK 8. I don't understand this and posted this question on Superuser:
from installer.
Thanks for your help. I'm thinking that I should probably land the change anyway to be consistent with Oracle and then we can do some further investigation.
from installer.
Something changed going from 11.0.8_10 to 11.0.9.1_1 and continues into 11.0.10_9. I have a jar file that I double click and worked until 11.0.9.1_1. I started getting that the jar file needed to be installed in and run from the user's home directory. I just went back to 11.0.8_10. Now I installed 11.0.10_9 and got the same. I guess "jar launcher.app" executed from the directory in which it resided, but now does not. I can execute java -jar xxxxx.jar from within the directory, but double click does not. This is not a big deal, I can work around, just a change.
from installer.
@todivefor could you please confirm the fix for me by running the following commands making sure that the INPUT_DIRECTORY variable is set correctly:
INPUT_DIRECTORY=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk /usr/libexec/PlistBuddy -c "Add :JavaVM:JVMCapabilities:1 string JNI" "${INPUT_DIRECTORY}/Contents/Info.plist" /usr/libexec/PlistBuddy -c "Add :JavaVM:JVMCapabilities:2 string BundledApp" "${INPUT_DIRECTORY}/Contents/Info.plist"
Hey.
I had this same issue, came across this issues thread. Fresh install of Mac OS Big Sur with Adopt Open JDK 11.
$ java -version
openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
I adjusted INPUT_DIRECTORY. I can now launch .jar files with the stock JavaLauncher.app without issue.
from installer.
@jwrb what did you adjust INPUT_DIRECTORY to be? Can you also send me your Info.plist
from installer.
@jwrb I would be glad to test. How do I change INPUT_DIRECTORY?
from installer.
@jwrb Nevermind
Ran:
PWRMacbookPro:~ userid$ INPUT_DIRECTORY=/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk
PWRMacbookPro:~ userid$ /usr/libexec/PlistBuddy -c "Add :JavaVM:JVMCapabilities:1 string JNI" "${INPUT_DIRECTORY}/Contents/Info.plist"
PWRMacbookPro:~ userid$ /usr/libexec/PlistBuddy -c "Add :JavaVM:JVMCapabilities:2 string BundledApp" "${INPUT_DIRECTORY}/Contents/Info.plist"
PWRMacbookPro:~ userid$
Got same result.
from installer.
Related Issues (20)
- Feature Request: Support Rocky 9 HOT 5
- Issue on Debian uploads when using upload "All" for Distribution option
- Create Pipeline For Performing Automated Testing Of Installer Processes
- CentOS/RHEL/Fedora repo is not working HOT 1
- Linux (RPM/DEB/APK) installer packages don't install javadoc package.
- Republish JDK21.0.2.0.0+13 Deb & RPMs With Freetype Library Fix
- Implement s390x Architecture Support For Linux Installers for JDK/JRE 21
- Documentation: Add Details On How To Use The Spec Files etc
- Republish JRE21 RHEL & SUSE PPC64LE Linux Packages Due To Issue In Spec File
- Debian installation instructions still use `/etc/apt/trusted.gpg.d` for storing the key HOT 3
- Add Riscv64 Support To Linux Installer Process HOT 4
- adjust rpms and (maybe) repositories so Temurin JDKs can serve as replacement of non-system JDKs in Fedora HOT 24
- fonts-dejavu is not installable and not included with basic installer ubuntu linux
- Support for new distributions - April 2024 HOT 4
- Packaging process does not work correctly for RPMs, when dist = all
- Windows ARM64 binaries are being installed to incorrect location
- Test
- April 2024 - Unix Installer Packages Release Tracker HOT 1
- Generated MSIs lack end-user license agreement HOT 10
- Alpine temurin ARM64 Package depends on x86 Package HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from installer.