Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExceptionInInitializerError from os.list on Java 17 but not Java 19 #242

Closed
vreuter opened this issue Dec 14, 2023 · 2 comments
Closed

ExceptionInInitializerError from os.list on Java 17 but not Java 19 #242

vreuter opened this issue Dec 14, 2023 · 2 comments
Milestone

Comments

@vreuter
Copy link

vreuter commented Dec 14, 2023

Hi, not sure if this is a known issue or if it's even helpful to raise here, so apologies in advance. I hit an issue recently, with version 0.9.2 of os-lib built on Scala 3.3.0 and running with a JAR with Java 17 in a Nix shell. My issue was similar to #24 ; the proximal and ultimate exceptions were similar in my case to that issue even if the context was a bit different.

The offending line looked like this:

Alternative[List].separate(os.list(folder).toList.filter(...).map(...))

and gave this error:

Exception in thread "main" java.lang.ExceptionInInitializerError
	at os.list$stream$$anon$1.generate(ListOps.scala:35)
	at geny.Generator.foreach(Generator.scala:51)
	at geny.Generator.foreach$(Generator.scala:33)
	at os.list$stream$$anon$1.foreach(ListOps.scala:31)
	at geny.Generator.toBuffer(Generator.scala:127)
	at geny.Generator.toBuffer$(Generator.scala:33)
	at os.list$stream$$anon$1.toBuffer(ListOps.scala:31)
	at geny.Generator.toArray(Generator.scala:131)
	at geny.Generator.toArray$(Generator.scala:33)
	at os.list$stream$$anon$1.toArray(ListOps.scala:31)
	at os.list$.apply(ListOps.scala:19)
	at os.list$.apply(ListOps.scala:23)
	...
Caused by: java.lang.IllegalArgumentException: requirement failed: ? is not an absolute path
	at scala.Predef$.require(Predef.scala:337)
	at os.Path.<init>(Path.scala:488)
	at os.Path$.apply(Path.scala:414)
	at os.package$.<clinit>(package.scala:29)
	... 19 more

Switching the Nix shell to Java 19 solved this problem, so I'm curious if this is something already known, and/or if it's perhaps possible to have a fix for Java 17? For my project it's fine to switch to Java 19 for now, I just worry if in the future I have a lower upper bound on version or if others do already, if a similar sticking point would arise.

Regardless, thanks a lot @lihaoyi for an excellent library :)

@lefou
Copy link
Member

lefou commented Dec 14, 2023

This is already fixed and will be released as 0.9.3.

@lefou lefou added this to the 0.9.3 milestone Dec 14, 2023
@lefou lefou closed this as completed Dec 14, 2023
@vreuter
Copy link
Author

vreuter commented Dec 14, 2023

Thanks a lot @lefou !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants