Reputation: 22936
Now I have installed Java 8. Please see the paths and do tell me what am I missing. JNLP files can't be launched with javaws
comand.
Macbook Air M1
% echo $PATH
/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
:/Users/xx/installations/icedtea/bin:/opt/homebrew/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
Java version:
% which java
/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/bin/java
% java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.292-b10, mixed mode)
% javaws
The operation couldn’t be completed. Unable to locate a Java Runtime that supports javaws.
Please visit http://www.java.com for information on installing Java.
% which javaws
/usr/bin/javaws
% cd /Library/Java/JavaVirtualMachines/
JavaVirtualMachines % ls
adoptopenjdk-8.jdk
Downloads % javaws xyz.jnlp
The operation couldn’t be completed. Unable to locate a Java Runtime that supports javaws.
Please visit http://www.java.com for information on installing Java.
Included symbolic link:
% sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk
I've read Unable to locate a Java Runtime that supports javaws although Java 8 is installed, but the answer talks of a setting in the MacBook which is not there in M1 series.
Upvotes: 0
Views: 153
Reputation: 22936
Well, the solution that worked was to install OpenWebStart_macos-aarch64_1_11_0.dmg
from: https://openwebstart.com/download/
Once it is installed you will see settings feature in its folder. If Mac complains about Proxy, we can set "No Proxy" from the settings of this software.
In System Settings->Privacy and Security->
(scroll down) give it permission to run.
Upvotes: 0
Reputation: 4380
It looks like it's an issue with that specific JDK installation. Not sure if OpenJDK 1.8 supports running jnlp files. I was able to run a jnlp on M1 using oracle Java SE 1.17 installation (and probably any newer version). That will do the Java setup registering a 1.8 version virtual machine compatible with java web start and run as expected. https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html
You can check the current JDK installed versions running
/usr/libexec/java_home -V
The result is something like this:
Matching Java Virtual Machines (3):
17.0.12 (arm64) "Oracle Corporation" - "Java SE 17.0.12" /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home
11.0.23 (arm64) "Amazon.com Inc." - "Amazon Corretto 11" /Users/username/Library/Java/JavaVirtualMachines/corretto-11.0.23/Contents/Home
1.8.421.09 (arm64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home
You can see 1.8.421.09 (arm64) is registered from the JDK 17 installation. Newer versions do the same setup (eg: JDK 21 LTS), to keep compatibility with javaws.
Upvotes: 2