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

Compatibility with Java 9 #515

Closed
Sanne opened this issue Sep 15, 2016 · 15 comments
Closed

Compatibility with Java 9 #515

Sanne opened this issue Sep 15, 2016 · 15 comments

Comments

@Sanne
Copy link

Sanne commented Sep 15, 2016

asciidoctorj is currently not going to work on Java 9 as this would require to update JRuby to at least version 9.1.3.0 according to @headius :

I'd highly appreciate some help to get this upgrade done!
I was going to try it myself but I found #362 which made me understand it's not a good task for a beginner (I'm not familiar with the project.. heck I don't even know Ruby!).

In Hibernate we've almost the full build working on Java 9 now, it's just missing a couple patches yet in Javassist but then the documentation still fails to build. We use asciidoctorj for all docs of course ;-)

@robertpanzer
Copy link
Member

When converting your docs with the asciidoctor-maven-plugin or asciidoctor-gradle-plugin you should be able to manually upgrade the dependency on org.jruby:jruby-complete 9.1.x.y (I think the latest version is even 9.1.5.0)

But we will probably not upgrade the version of JRuby in asciidoctorJ 1.5.x to 9.x.y.z as this breaks compatibility with Java 6 and I am not in favor of doing such a drastic change of the requirements in a minor release.

The next "major" version 1.6.0 will be based on JRuby 9.x.y.z instead.

So to sum it up: you are free to use another, newer version of JRuby which hopefully works with Java9.
But we don't want loose users in a minor release.

I personally didn't find the time yet to test it out on Java9 but hope to find that time soon.

Another note: if you already tried it out yourself with Java9 it would be great if you could attach any error logs etc to this issue, this helps a lot.

@Sanne
Copy link
Author

Sanne commented Sep 15, 2016

Hi @robertpanzer ! Thanks for the quick reply.

I'd be happy to use version 1.6.0, I wasn't implying this upgrade should happen in any specific version.

When I override the JRuby version of the asciidoctor-maven-plugin our documentation seems to build fine indeed; thanks for the hint!
I could probably use this for now, but it makes me a bit nervous to know that this configuration actually fails some tests when I try the same override and run the build of asciidoctor-maven-plugin or asciidoctorj.
There are failures in your testsuite even running with the combination JRuby 9.1.5.0 on Java 8.

@mojavelinux
Copy link
Member

@Sanne Are you using Java-based extensions at all, or are you just using AsciidoctorJ by way of the Maven plugin? If the latter, you shouldn't really be nervous about which version of AsciidoctorJ you are using since in that use case, it's just a thin wrapper to call the same Asciidoctor core under the covers. When it really matters which AsciidoctorJ you are using is when you are using the Java API. And if you are using the Java API, I recommend for projects who can to use AsciidoctorJ 1.6.0 alpha.

There are failures in your testsuite even running with the combination JRuby 9.1.5.0 on Java 8.

We probably should to be testing AsciidoctorJ against the latest JRuby release in CI.

@Sanne
Copy link
Author

Sanne commented Sep 16, 2016

Interesting, thanks @mojavelinux !

We don't use extensions in Hibernate ORM, Hibernate OGM, Hibernate Search. We use them for the Bean Validation specification. I'll update the first group so we'll see how it does if someone notices any rendering problem.

@headius
Copy link
Contributor

headius commented Sep 21, 2016

If you need assistance getting asciidoctorj running on JRuby 9.1.3.0+, let us know. Don't assume it's your fault if something fails.

We probably would accept patches to get JRuby 1.7.x running on Java 9, but we still intend to EOL JRuby 1.7.x by year's end (jruby/jruby#4112).

@mojavelinux
Copy link
Member

Thanks @headius!

@johnpoth
Copy link

Fails on Apache Camel using java 9 build 156 even when upgrading to jruby 9.1.7.0. Workaround is to set

export MAVEN_OPTS="--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED"

Though the issue seems to come more from JRuby than from asciidoctor.

2017-02-20T12:37:59.111+01:00 [main] ERROR JavaProxyClassFactory : could not use ClassLoader.defineClass method
java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @4b9dbf07
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:207)
	at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:192)
	at java.base/java.lang.reflect.Method.setAccessible(Method.java:186)
	at org.jruby.javasupport.proxy.JavaProxyClassFactory$1.run(JavaProxyClassFactory.java:219)
	at org.jruby.javasupport.proxy.JavaProxyClassFactory$1.run(JavaProxyClassFactory.java:212)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at org.jruby.javasupport.proxy.JavaProxyClassFactory.<clinit>(JavaProxyClassFactory.java:212)
	at org.jruby.javasupport.proxy.JavaProxyClass.<clinit>(JavaProxyClass.java:89)
	at org.jruby.javasupport.Java.createJavaModule(Java.java:163)
	at org.jruby.javasupport.Java.load(Java.java:103)
	at org.jruby.runtime.load.LoadService.reflectedLoad(LoadService.java:590)
	at org.jruby.ext.LateLoadingLibrary.load(LateLoadingLibrary.java:48)
	at org.jruby.runtime.load.LibrarySearcher$FoundLibrary.load(LibrarySearcher.java:34)
	at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:887)
	at org.jruby.runtime.load.LoadService.smartLoadInternal(LoadService.java:527)
	at org.jruby.runtime.load.LoadService.require(LoadService.java:398)
	at org.jruby.ext.jruby.JRubyLibrary.load(JRubyLibrary.java:57)
	at org.jruby.runtime.load.LoadService.reflectedLoad(LoadService.java:590)
	at org.jruby.ext.LateLoadingLibrary.load(LateLoadingLibrary.java:48)
	at org.jruby.runtime.load.LibrarySearcher$FoundLibrary.load(LibrarySearcher.java:34)
	at org.jruby.runtime.load.LoadService.tryLoadingLibraryOrScript(LoadService.java:887)
	at org.jruby.runtime.load.LoadService.smartLoadInternal(LoadService.java:527)
	at org.jruby.runtime.load.LoadService.require(LoadService.java:398)
	at org.jruby.Ruby.init(Ruby.java:1203)
	at org.jruby.Ruby.newInstance(Ruby.java:334)
	at org.jruby.javasupport.JavaEmbedUtils.initialize(JavaEmbedUtils.java:79)
	at org.asciidoctor.internal.JRubyAsciidoctor.createJRubyAsciidoctorInstance(JRubyAsciidoctor.java:126)
	at org.asciidoctor.internal.JRubyAsciidoctor.create(JRubyAsciidoctor.java:57)
	at org.asciidoctor.Asciidoctor$Factory.create(Asciidoctor.java:668)
	at org.apache.camel.maven.packaging.PrepareCatalogMojo.executeDocuments(PrepareCatalogMojo.java:987)
	at org.apache.camel.maven.packaging.PrepareCatalogMojo.execute(PrepareCatalogMojo.java:205)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:543)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

@mojavelinux
Copy link
Member

A new JRuby is in the works right now. Is this something we need to report? cc: @headius

@rahmanusta
Copy link

I try AsciidoctorJ with Java 9. The core works well, but I get a SSL exception while generating PDF with asciidoctorj-pdf.

org.jruby.exceptions.RaiseException: (OpenSSL::X509::StoreError) setting default path failed: No password supplied for PKCS#12 KeyStore.
	at org.jruby.ext.openssl.X509Store.set_default_paths(org/jruby/ext/openssl/org/jruby/ext/openssl/X509Store.java:185)
	at RUBY.(root)(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/jopenssl/load.rb:22)
	at RUBY.(root)(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/jopenssl/load.rb:22)
	at RUBY.(root)(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1)
	at RUBY.(root)(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1)
	at RUBY.require(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54)
	at RUBY.require(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54)
	at RUBY.(root)(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/openssl.rb:1)
	at RUBY.(root)(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/openssl.rb:1)
	at RUBY.(root)(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1)
	at RUBY.(root)(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1)
	at RUBY.require(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54)
	at RUBY.require(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54)
	at RUBY.(root)(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/2.0/net/https.rb:22)
	at RUBY.(root)(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/2.0/net/https.rb:22)
	at RUBY.(root)(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1)
	at RUBY.(root)(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1)
	at RUBY.require(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54)
	at RUBY.require(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54)
	at RUBY.(root)(C:/Users/usta/.m2/repository/org/asciidoctor/asciidoctorj-pdf/1.5.0-alpha.16/asciidoctorj-pdf-1.5.0-alpha.16.jar!/gems/css_parser-1.5.0/lib/css_parser.rb:3)
	at RUBY.(root)(C:/Users/usta/.m2/repository/org/asciidoctor/asciidoctorj-pdf/1.5.0-alpha.16/asciidoctorj-pdf-1.5.0-alpha.16.jar!/gems/css_parser-1.5.0/lib/css_parser.rb:3)
	at RUBY.(root)(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1)
	at RUBY.(root)(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1)
	at RUBY.require(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54)
	at RUBY.require(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54)
	at RUBY.(root)(C:/Users/usta/.m2/repository/org/asciidoctor/asciidoctorj-pdf/1.5.0-alpha.16/asciidoctorj-pdf-1.5.0-alpha.16.jar!/gems/prawn-svg-0.27.1/lib/prawn-svg.rb:6)
	at RUBY.(root)(C:/Users/usta/.m2/repository/org/asciidoctor/asciidoctorj-pdf/1.5.0-alpha.16/asciidoctorj-pdf-1.5.0-alpha.16.jar!/gems/prawn-svg-0.27.1/lib/prawn-svg.rb:6)
	at RUBY.(root)(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1)
	at RUBY.(root)(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1)
	at RUBY.require(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54)
	at RUBY.require(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54)
	at RUBY.(root)(C:/Users/usta/.m2/repository/org/asciidoctor/asciidoctorj-pdf/1.5.0-alpha.16/asciidoctorj-pdf-1.5.0-alpha.16.jar!/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/prawn-svg_ext.rb:1)
	at RUBY.(root)(C:/Users/usta/.m2/repository/org/asciidoctor/asciidoctorj-pdf/1.5.0-alpha.16/asciidoctorj-pdf-1.5.0-alpha.16.jar!/gems/asciidoctor-pdf-1.5.0.alpha.16/lib/asciidoctor-pdf/prawn-svg_ext.rb:1)
	at RUBY.(root)(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1)
	at RUBY.(root)(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:1)
	at RUBY.require(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54)
	at RUBY.require(/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54)
	at RUBY.require_relative(file:/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/jruby/kernel19/kernel.rb:24)
	at RUBY.require_relative(file:/C:/Users/usta/.m2/repository/org/jruby/jruby-complete/1.7.21/jruby-complete-1.7.21.jar!/jruby/kernel19/kernel.rb:24)

@robertpanzer
Copy link
Member

That version of AsciidoctorJ-PDF shouldn't be compatible with JRuby 1.7.xx.
On Windows it should be at least 9.1.8.0.
Could you please retry with that version?

@rahmanusta
Copy link

rahmanusta commented Aug 30, 2017

@robertpanzer AsciidoctorJ 1.5.4 still uses JRuby 1.7.21 in its dependency graph. Which AsciidoctorJ and AsciidoctorJ-Pdf dependency combination should I use? I tried several combinations but neither of them works so far.

@mojavelinux
Copy link
Member

Thanks for testing Java 9, @rahmanusta. I know this is something the OpenJDK team is looking feedback on, so your feedback is very valuable to them as well as the AsciidoctorJ project.

@remmeier
Copy link

classpath 'org.jruby:jruby-complete:9.1.17.0'
classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.7'
classpath 'org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16'

works well for me with Java 10 (on Windows at least). Would be great if this gets resolved to avoid having to fiddle around with versions.

yurloc added a commit to yurloc/optaweb-vehicle-routing that referenced this issue Feb 3, 2020
This fixes a problem when building on OpenJDK 11.

See also asciidoctor/asciidoctorj#515.
yurloc added a commit to kiegroup/optaweb-vehicle-routing that referenced this issue Feb 4, 2020
This fixes a problem when building on OpenJDK 11.

See also asciidoctor/asciidoctorj#515.
@headius
Copy link
Contributor

headius commented Jul 18, 2020

Pretty sure this should be ok with a more recent JRuby, if that hasn't happened already.

@robertpanzer
Copy link
Member

Oh yes, we also have the CI running with Java 11 now.
Closing this issue.

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

7 participants