arton / rjb

Ruby Java Bridge
https://www.artonx.org/collabo/backyard/?RubyJavaBridge
GNU Lesser General Public License v2.1
117 stars 34 forks source link

OpenJDK 11 compatibility #75

Closed albandum closed 4 years ago

albandum commented 4 years ago

Hello, I've been getting the same issue than https://github.com/arton/rjb/issues/69 for a few days, and finally downgraded from openJDK11 to openjdk8 -> It worked !

Are you planning on making rjb work on openjdk 11 by any chance ? Thanks !

arton commented 4 years ago

Hi albandum Thank you for your report.

At this time I only tested with java 1.8.0_20 by Apple. But moving to OpenJDK11 is reasonable to me. I don't want to support many cases, so I'd like to know your install method. Did you install your OpenJDK11 by Homebrew (= Oracle built) or by hand (from jdk.java.net)? The later is my target in near future.

Regards

albandum commented 4 years ago

Hi, thanks for the quick reply ! I'm running on a docker container, on Ubuntu 20.04 with that command to install it during the build :

RUN apt-get update && apt-get install -y git openjdk-11-jre-headless openjdk-11-jdk-headless

When I force openJDK8 with adoptOpenJDK that way, it works fine :

RUN wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | apt-key add -
RUN add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
RUN apt-get update && apt-get install -y adoptopenjdk-8-hotspot

Thanks !

arton commented 4 years ago

Hi Thank you for your info. I misunderstood that your box is MAC. Linux is my main target so I will start to investigate soon. ... I could reproduce Constant DL and Fiddle is not defined. BTW, 'DL or Fiddle' are the correct words aren't they?

albandum commented 4 years ago

... I could reproduce Constant DL and Fiddle is not defined. BTW, 'DL or Fiddle' are the correct words aren't they?

I'm not sure what you mean with this question ? I basically am hitting this line I think when trying to run RJB on openJDK11 : https://github.com/arton/rjb/blob/faee51fad1a4f7cf608bfe0485d8cc244b6a6991/ext/load.c#L140

Thanks a lot for your reactivity and your work in general ! :)

PS : My box is actually a mac, but I've dockerized my RJB app because it wasn't working on all my machines the same way haha.

akiotajima commented 4 years ago

My question was about English writing.

albandum commented 4 years ago

Looks like you're talking about two constants. If you need the 2 that would be :

Constants DL and Fiddle are not defined.

If you need only one or the other : Constants DL or Fiddle need to be defined.

akiotajima commented 4 years ago

I remeber I have already prepared the simple workaround for this. You may set environment variable JVM_LIB, Rjb is forced to take this first.

ex)

export JVM_LIB=$JAVA_HOME/lib/server/libjvm.so
ruby -rrjb -e 'Rjb::load'

Regards

arton commented 4 years ago

Hi albandum

I fixed the JDK directory and push rjb-1.6.2.gem to rubygems.org. Thank you for your cooperation.

albandum commented 4 years ago

I fixed the JDK directory and push rjb-1.6.2.gem to rubygems.org.

This is awesome, thanks for your reactivity !