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

sun.misc does not exist build issue. #5699

Closed
FuncGuy opened this issue Apr 16, 2019 · 14 comments
Closed

sun.misc does not exist build issue. #5699

FuncGuy opened this issue Apr 16, 2019 · 14 comments
Milestone

Comments

@FuncGuy
Copy link
Contributor

FuncGuy commented Apr 16, 2019

Hi,
when i try to build jruby with jdk 11 getting a compiler error "java package sun.misc does not exist".
please have a look.

@headius
Copy link
Member

headius commented Apr 16, 2019

I can reproduce problems during the build.

Caused by: 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/X509Store.java:165)
	at RUBY.SSLContext(uri:classloader:/META-INF/jruby.home/lib/ruby/shared/jopenssl19/openssl/ssl-internal.rb:31)
	at RUBY.SSL(uri:classloader:/META-INF/jruby.home/lib/ruby/shared/jopenssl19/openssl/ssl-internal.rb:22)
	at RUBY.OpenSSL(uri:classloader:/META-INF/jruby.home/lib/ruby/shared/jopenssl19/openssl/ssl-internal.rb:21)
	at RUBY.(root)(uri:classloader:/META-INF/jruby.home/lib/ruby/shared/jopenssl19/openssl/ssl-internal.rb:20)

We have attempted to fix this before: #4805, #4799

Looking at the backtraces, I can see that jruby-openssl is loading the 1.9-compatible logic, which means this could not possibly be using JRuby 9.x. Something in this process is attempting to use an older JRuby 1.7.x.

@mkristian You helped someone else stumbling into JRuby 1.7 in #4805, but in this case we are simply trying to build JRuby itself. I thought for sure we had full builds working under Java 9+.

This only appears to affect the "bootstrap" maven profile, so it should still be possible for you to build JRuby and get a usable distribution out of it. The "bootstrap" profile just installs tools necessary for working on JRuby itself.

@headius
Copy link
Member

headius commented Apr 16, 2019

@FuncGuy Please post full output of your build, adding -X to the mvn command line. That output will be very long, so please use gist.github.com or similar.

Now on a second attempt I can't get the error to fail. All I did in between was run keytool -list -cacerts and entered a blank password when prompted.

@headius
Copy link
Member

headius commented Apr 16, 2019

I cannot reproduce the sun.misc issue. We do reference that package in various places but it builds ok for me on Java 9+.

I still can't reproduce the keystore error.

@FuncGuy
Copy link
Contributor Author

FuncGuy commented Apr 16, 2019

if i compile with mvn command build will be success but if i run any tests or when i select build project option then it is throwing this compiler error(sun.misc).

@headius
Copy link
Member

headius commented Apr 17, 2019

Aha! So you are trying to build and run tests within IntelliJ I guess?

Yes, this configuration is not currently supported, mostly because our build is significantly more complex than the typical Java application. I'd certainly like this to work, though...

@FuncGuy
Copy link
Contributor Author

FuncGuy commented Apr 17, 2019

yes i'm using intelliJ.. is there any chance that i work on this as a first contributor?

@headius
Copy link
Member

headius commented Apr 18, 2019

@FuncGuy That would be excellent! You should connect with @mkristian here or on Gitter since he's our build expert. I don't think this will take too much work. We may just have to add some flags to the build when running on 9+ to open up that package. I don't know how IntelliJ decides to compile things based on a maven project.

@FuncGuy
Copy link
Contributor Author

FuncGuy commented Apr 18, 2019

Now i'm not getting sun.misc error but getting another error "javax.annotation.Generated" can not find symbol.

FuncGuy added a commit to FuncGuy/jruby that referenced this issue Apr 18, 2019
@headius
Copy link
Member

headius commented Apr 21, 2019

Yeah, that package got moved out with the module system. Looks like you have a workaround already!

@FuncGuy
Copy link
Contributor Author

FuncGuy commented Apr 21, 2019

yep! I've added the javax.annotation dependency and raised the PR.

@headius
Copy link
Member

headius commented Apr 25, 2019

@FuncGuy If you can tidy up that PR in the way @mkristian suggested, I see no reason we can't merge it. Are you able to build under IntelliJ after those changes?

headius added a commit that referenced this issue May 14, 2019
#5699:adding the javax maven dependency to avoid "javax.annotation.Ge…
@FuncGuy
Copy link
Contributor Author

FuncGuy commented May 15, 2019

@headius we have to configure some settings in intellij for annotation processing to activate.. so this PR will not impact much.

@FuncGuy FuncGuy closed this as completed Jul 3, 2019
@kares kares added this to the Won't Fix milestone Jul 4, 2019
@robevansuk
Copy link

Not sure if this helps at this stage but I had this error with the netty/netty project. One setting I needed to change to get things working in intelliJ was:
Preferences -> Build, Execution, Deployment -> Compiler -> Java Compiler -> (untick) Use '--release' option for cross-compilation (Java 9 and later)
The next setting I switched on was under the maven settings so this may/not be relevant:
Preferences -> Build, Execution, Deployment -> Build Tools -> Maven -> (tick) Use plugin registry

@sonhmai
Copy link

sonhmai commented Nov 19, 2022

@robevansuk thanks a lot, this actually solved the 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

5 participants