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

Open
FuncGuy opened this issue Apr 16, 2019 · 12 comments

Comments

Projects
None yet
2 participants
@FuncGuy
Copy link
Contributor

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor Author

commented Apr 17, 2019

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

@headius

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Contributor Author

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

This comment has been minimized.

Copy link
Member

commented Apr 21, 2019

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

@FuncGuy

This comment has been minimized.

Copy link
Contributor Author

commented Apr 21, 2019

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

@headius

This comment has been minimized.

Copy link
Member

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

Merge pull request #5702 from FuncGuy/5699
#5699:adding the javax maven dependency to avoid "javax.annotation.Ge…
@FuncGuy

This comment has been minimized.

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.