You are not logged in.

#1 2018-03-01 17:01:20

kinleyd
Member
From: Bhutan
Registered: 2012-09-21
Posts: 142

[Solved] Error when Setting java-9-openjdk/jre as default

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

#2 2018-03-01 17:07:23

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Solved] Error when Setting java-9-openjdk/jre as default

Paste the output of:

archlinux-java status

Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2018-03-01 17:14:25

kinleyd
Member
From: Bhutan
Registered: 2012-09-21
Posts: 142

Re: [Solved] Error when Setting java-9-openjdk/jre as default

Thanks for responding!

$ archlinux-java status                                                                                                   
Available Java environments:                                                                                                           
  java-8-openjdk (default)
  java-9-openjdk

Offline

#4 2018-03-01 17:26:37

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,657

Re: [Solved] Error when Setting java-9-openjdk/jre as default

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

#5 2018-03-01 17:35:06

kinleyd
Member
From: Bhutan
Registered: 2012-09-21
Posts: 142

Re: [Solved] Error when Setting java-9-openjdk/jre as default

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

#6 2018-03-01 17:44:44

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,096

Re: [Solved] Error when Setting java-9-openjdk/jre as default

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

#7 2018-03-01 17:49:08

kinleyd
Member
From: Bhutan
Registered: 2012-09-21
Posts: 142

Re: [Solved] Error when Setting java-9-openjdk/jre as default

twelveeighty wrote:

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

#8 2018-03-01 18:00:12

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,096

Re: [Solved] Error when Setting java-9-openjdk/jre as default

kinleyd wrote:

Yes, if I drop the /jre suffix openjdk9 gets set as the default.

kinleyd wrote:

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

#9 2018-03-01 18:06:19

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: [Solved] Error when Setting java-9-openjdk/jre as default

kinleyd wrote:

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.

Offline

#10 2018-03-01 18:06:19

kinleyd
Member
From: Bhutan
Registered: 2012-09-21
Posts: 142

Re: [Solved] Error when Setting java-9-openjdk/jre as default

Sorry. I meant archlinux-java, when trying to set java-9-openjdk/jre.

Offline

#11 2018-03-01 18:10:49

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: [Solved] Error when Setting java-9-openjdk/jre as default

So stop trying to set it to something that doesn't exist.

Offline

#12 2018-03-01 18:12:39

kinleyd
Member
From: Bhutan
Registered: 2012-09-21
Posts: 142

Re: [Solved] Error when Setting java-9-openjdk/jre as default

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

#13 2018-03-01 18:13:43

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,544

Re: [Solved] Error when Setting java-9-openjdk/jre as default

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)

Offline

#14 2018-03-01 18:20:21

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [Solved] Error when Setting java-9-openjdk/jre as default

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 ' |

Online

#15 2018-03-01 18:20:51

kinleyd
Member
From: Bhutan
Registered: 2012-09-21
Posts: 142

Re: [Solved] Error when Setting java-9-openjdk/jre as default

Hmmm. OK, thanks. Guess I'll just stay with openjdk8 till I find some solution.

Offline

#16 2018-03-01 18:22:36

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,096

Re: [Solved] Error when Setting java-9-openjdk/jre as default

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

#17 2018-03-01 18:25:57

kinleyd
Member
From: Bhutan
Registered: 2012-09-21
Posts: 142

Re: [Solved] Error when Setting java-9-openjdk/jre as default

progandy wrote:

As of java-9-openjdk, the jre and jdk have the same path, no need and possibility to choose anymore.

Thanks.

Offline

#18 2018-03-01 18:28:22

kinleyd
Member
From: Bhutan
Registered: 2012-09-21
Posts: 142

Re: [Solved] Error when Setting java-9-openjdk/jre as default

twelveeighty wrote:

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.

smile 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

#19 2018-03-01 18:34:12

twelveeighty
Member
From: Alberta, Canada
Registered: 2011-09-04
Posts: 1,096

Re: [Solved] Error when Setting java-9-openjdk/jre as default

That looks like a legit bug / incompatibility of Conjure with JDK 9 to me, see: https://community.oracle.com/thread/4011800

Offline

#20 2018-03-01 18:37:06

kinleyd
Member
From: Bhutan
Registered: 2012-09-21
Posts: 142

Re: [Solved] Error when Setting java-9-openjdk/jre as default

twelveeighty wrote:

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

#21 2018-03-01 18:46:38

kinleyd
Member
From: Bhutan
Registered: 2012-09-21
Posts: 142

Re: [Solved] Error when Setting java-9-openjdk/jre as default

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

#22 2018-03-01 19:32:04

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [Solved] Error when Setting java-9-openjdk/jre as default

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.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#23 2018-03-02 06:44:26

kinleyd
Member
From: Bhutan
Registered: 2012-09-21
Posts: 142

Re: [Solved] Error when Setting java-9-openjdk/jre as default

Done, Jason. And my thanks to everyone for their quick and helpful responses.

Offline

Board footer

Powered by FluxBB