Giter VIP home page Giter VIP logo

Comments (16)

LittlestCube avatar LittlestCube commented on June 12, 2024 1

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.

CatalinaJarLauncher.zip

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:

Screen Shot 2020-05-23 at 4 36 13 PM

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.

gdams avatar gdams commented on June 12, 2024

@todivefor any idea how this would be associated?

from installer.

gdams avatar gdams commented on June 12, 2024

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.

gdams avatar gdams commented on June 12, 2024

Or is this to do with making jar launcher.app use adoptopenjdk Java rather than another vendor?

from installer.

gdams avatar gdams commented on June 12, 2024

running a test build with this fix: #95

from installer.

gdams avatar gdams commented on June 12, 2024

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

todivefor avatar todivefor commented on June 12, 2024

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

gdams avatar gdams commented on June 12, 2024

hmmm okay, do you know if an Oracle Java 11 works with this?

from installer.

todivefor avatar todivefor commented on June 12, 2024

I do not, but I can give it a try.

from installer.

todivefor avatar todivefor commented on June 12, 2024

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:

https://superuser.com/questions/1429769/netbeans-java-platform-and-source-binary-format-inconsistency

from installer.

gdams avatar gdams commented on June 12, 2024

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.

todivefor avatar todivefor commented on June 12, 2024

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.

jwrb avatar jwrb commented on June 12, 2024

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

gdams avatar gdams commented on June 12, 2024

@jwrb what did you adjust INPUT_DIRECTORY to be? Can you also send me your Info.plist

from installer.

todivefor avatar todivefor commented on June 12, 2024

@jwrb I would be glad to test. How do I change INPUT_DIRECTORY?

from installer.

todivefor avatar todivefor commented on June 12, 2024

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

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.