You are not logged in.
I have openjdk8 as my current default. After installing jre9-openjdk-headless jre9-openjdk jdk9-openjdk from the repos, I ran:
$ sudo archlinux-java set java-9-openjdk/jre
and get this error:
'/usr/lib/jvm/java-9-openjdk/jre' is not a valid Java environment path
When I last installed openjdk8, setting the default worked without having to futz with the path to jre.
Is there something different I have to do to get archlinux-java set to work on openjdk9?
Last edited by kinleyd (2018-03-02 06:45:04)
Offline
Paste the output of:
archlinux-java status
Offline
Thanks for responding!
$ archlinux-java status
Available Java environments:
java-8-openjdk (default)
java-9-openjdk
Offline
If you have the jdk installed then pass the jdk, the "/jre" suffix is only for those cases where one has only the jre installed and not the jdk .
Offline
Yes, if I drop the /jre suffix openjdk9 gets set as the default. Only problem is I need /jre also to be set this way, otherwise my Clojure setup doesn't work.
Offline
That is likely a problem with Clojure then with JDK 9, since Oracle/OpenJDK changed the folder layout for Java 9 to no longer have a /jre subfolder: http://openjdk.java.net/jeps/220
Offline
That is likely a problem with Clojure then with JDK 9, since Oracle/OpenJDK changed the folder layout for Java 9 to no longer have a /jre subfolder: http://openjdk.java.net/jeps/220
Yes, I did notice the change in folder layout between openjdk8 and 9.
However, is there a recommended way to change the path archlinux-java looks for? It currently is looking for '/usr/lib/jvm/java-9-openjdk/jre'
Offline
Yes, if I drop the /jre suffix openjdk9 gets set as the default.
It currently is looking for '/usr/lib/jvm/java-9-openjdk/jre'
What is "it" in your last comment? archlinux-java or Clojure? If it's Clojure, I'd say it's a bug with Clojure, since it should not look for /jre on JDK9. If "it" is archlinux-java, are you saying it fails to set the default to JDK9?
Offline
However, is there a recommended way to change the path archlinux-java looks for? It currently is looking for '/usr/lib/jvm/java-9-openjdk/jre'
No, it isn't. archlinux-java has nothing to do with that.
Online
Sorry. I meant archlinux-java, when trying to set java-9-openjdk/jre.
Offline
So stop trying to set it to something that doesn't exist.
Online
Hey Scimmia, long time!
I'm a little confused.
$ sudo archlinux-java set java-9-openjdk/jre
returns this:
'/usr/lib/jvm/java-9-openjdk/jre' is not a valid Java environment path
Doesn't that suggest it has some hardcoded path to jre that it's looking for?
Offline
No, it means there's no such thing as java-9-openjdk/jre in java 9 as you have it installed. Your only options are the ones listed in the status output you posted back in post #3
Last edited by Scimmia (2018-03-01 18:14:32)
Online
As of java-9-openjdk, the jre and jdk have the same path, no need and possibility to choose anymore.
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
Hmmm. OK, thanks. Guess I'll just stay with openjdk8 till I find some solution.
Offline
You're trying to "fix" the wrong problem: use archlinux-java to set "java-9-openjdk" (which works, as you reported earlier) and then post back the error(s) you're getting when you're running Clojure.
Offline
As of java-9-openjdk, the jre and jdk have the same path, no need and possibility to choose anymore.
Thanks.
Offline
You're trying to "fix" the wrong problem: use archlinux-java to set "java-9-openjdk" (which works, as you reported earlier) and then post back the error(s) you're getting when you're running Clojure.
Thanks. Here's what I get:
Debugger entered--Lisp error: (error "Could not start nREPL server: Exception in thread \"main\" java.lang.ClassCastException: java.base/jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to java.base/java.net.URLClassLoader
at Boot.loadJar(Boot.java:228)
at Boot.main(Boot.java:254)
")
signal(error ("Could not start nREPL server: Exception in thread \"main\" java.lang.ClassCastException: java.base/jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to java.base/java.net.URLClassLoader\n at Boot.loadJar(Boot.java:228)\n at Boot.main(Boot.java:254)\n"))
error("Could not start nREPL server: %s" "Exception in thread \"main\" java.lang.ClassCastException: java.base/jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to java.base/java.net.URLClassLoader\n at Boot.loadJar(Boot.java:228)\n at Boot.main(Boot.java:254)\n")
nrepl-server-sentinel(#<process nrepl-server> "exited abnormally with code 1\n")
Offline
That looks like a legit bug / incompatibility of Conjure with JDK 9 to me, see: https://community.oracle.com/thread/4011800
Offline
That looks like a legit bug / incompatibility of Conjure with JDK 9 to me, see: https://community.oracle.com/thread/4011800
Thanks. Searching through the Clojure community (after being one track minded on the java side!) it turns out to be a recognized and as-yet unresolved issue between Clojure and java 9.
Offline
This seems to be a pretty significant issue. @tommyettinger commented on Oct 8, 2017 on Leiningen issue:
"Just as an aside, when I opened this issue over a year ago, the reason Java 9 broke compatibility was completely different than the current one. It's pretty shocking that no one in the OpenJDK team tested major alternative JVM languages effectively enough to find this problem as development moved forward (at times recklessly, e.g. when the sun.misc package was removed). Also, Gradle was completely devastated by the loss of sun.misc.Unsafe, and somehow they were able to make that known and incline the OpenJDK developers to restore it. It would be nice if Leiningen development could have a voice in that kind of area, though I don't know how that whole ordeal resolved itself. While the OpenJDK and especially Oracle side has me feeling disheartened about the future of the JVM, it's encouraging to see not just comments, but commits, by both Leiningen and Clojure developers to fix this issue. It looks to me like Java 9 will be unsuitable for my usage for some time (the LWJGL3 graphics library still isn't especially compatible), but I'm sure by the time most libraries have fixed compatibility issues, Clojure will already have a new stable release (maybe more than one), and Leiningen will be working out-of-the-box once more."
Offline
The Closure thing is a separate issue. Please remember to mark your thread as [Solved] by editing your first post and prepending it to the title.
Offline
Done, Jason. And my thanks to everyone for their quick and helpful responses.
Offline