Jruby version suitable for OpenJDK 8 (Zulu JDK) - jruby

I am looking for an advisable version of JRuby that supports OpenJDK-8 (Zulu-JDK) to run on a Rails project.
Rails version- 4.0.13.

All versions of JRuby since version 9.2.0.0 will run on JDK 8. Since Zulu 8 is a build of OpenJDK 8 that means any appropriate JRuby version will run on Zulu 8.

Follow up question (using answer section to get better code formatting then commenting on the answer above).
I'm trying to get JRuby > 9.2.0.0 running Zulu 8 for MacOS ARM 64-bit (M1 chip).
I did a reinstall of the JRuby versions after installing that JDK.
$ rvm list
jruby-1.7.27 [ x86_64 ]
=> jruby-9.2.13.0 [ aarch64 ]
Check ruby version and try irb:
$ ruby -v
jruby 9.2.13.0 (2.5.7) 2020-08-03 9a89c94bcc OpenJDK 64-Bit Server VM 25.302-b08 on 1.8.0_302-b08 +jit [darwin-aarch64]
$ irb
NotImplementedError: fstat unimplemented unsupported or native support failed to load; see https://github.com/jruby/jruby/wiki/Native-Libraries
initialize at org/jruby/RubyIO.java:1015
open at org/jruby/RubyIO.java:1156
initialize at /Users/rrickerts/.rvm/rubies/jruby-9.2.13.0/lib/ruby/stdlib/irb/input-method.rb:141
initialize at /Users/rrickerts/.rvm/rubies/jruby-9.2.13.0/lib/ruby/stdlib/irb/context.rb:70
initialize at /Users/rrickerts/.rvm/rubies/jruby-9.2.13.0/lib/ruby/stdlib/irb.rb:410
start at /Users/rrickerts/.rvm/rubies/jruby-9.2.13.0/lib/ruby/stdlib/irb.rb:381
<main> at /Users/rrickerts/.rvm/rubies/jruby-9.2.13.0/bin/irb:13

Related

Shadow cljs doesn’t see java on Macbook M1

I used npx create-cljs-project my-app and revived error when I tried to start with npm start
I have tried few java ask version, but I get same error anyway.
shadow-cljs - config: /Users/tomaszsikora/dev/my-app/shadow-cljs.edn
Execution error (UnsatisfiedLinkError) at java.lang.ClassLoader/loadLibrary (ClassLoader.java:2398).
Can't load library: /var/folders/x7/k_6f989d60z2k0pz_cz_3y_40000gn/T/jna1171015707293329039.tmp
Full report at:
/var/folders/x7/k_6f989d60z2k0pz_cz_3y_40000gn/T/clojure-11795200488797552517.edn
and it starts like this, but it's too long to paste here.
{:clojure.main/message
"Execution error (UnsatisfiedLinkError) at java.lang.ClassLoader/loadLibrary (ClassLoader.java:2398).\nCan't load library: /var/folders/x7/k_6f989d60z2k0pz_cz_3y_40000gn/T/jna14133068692257536681.tmp\n",
:clojure.main/triage
{:clojure.error/class java.lang.UnsatisfiedLinkError,
:clojure.error/line 2398,
:clojure.error/cause
"Can't load library: /var/folders/x7/k_6f989d60z2k0pz_cz_3y_40000gn/T/jna14133068692257536681.tmp",
:clojure.error/symbol java.lang.ClassLoader/loadLibrary,
:clojure.error/source "ClassLoader.java",
:clojure.error/phase :execution},
:clojure.main/trace
{:via
[{:type java.lang.UnsatisfiedLinkError,
:message
"Can't load library: /var/folders/x7/k_6f989d60z2k0pz_cz_3y_40000gn/T/jna14133068692257536681.tmp",
:at [java.lang.ClassLoader loadLibrary "ClassLoader.java" 2398]}],
:trace
java version
tomaszsikora#DeadBook-Void my-app % java --version
openjdk 18.0.2.1 2022-08-18
OpenJDK Runtime Environment Homebrew (build 18.0.2.1+0)
OpenJDK 64-Bit Server VM Homebrew (build 18.0.2.1+0, mixed mode, sharing)

GlassFish 5.0 exception and port 4848 not responding

Yesterday i downloaded GlassFish 5.0 and JDK9. When I'm trying to run server with asadmin start-domain GlassFish send to me exception
When I try to use "asadmin start-domainAfter" I got respond: "Remote server does not listen request on [localhost 4848]. Is the serwer up?"
Any can help me with this? I looked for solution at google, I tried kill process using port 4848, change port 4848 in domain.xml on another one, nothing helps.
It's my firts time with glassfish I don't know what to do. Anyone can help me?
I'm working at windows 7, InteliJ Ultimate 2017.2.4, JRE 1.8 and JDK 9.
GlassFish 5.0 not starting on JDK 9 is a known issue.
GlassFish 5.0 is certified only on JDK 8 (u144) as stated in the release notes:
https://javaee.github.io/glassfish/doc/5.0/release-notes.pdf
I use Windows 10 and I have installed JDK and JRE for version 9 and 8u141, 8u151, 8u144 (installed for test about this problem)
For exception I had had the same problem : the command "asadmin start-version" throw an exception.
Just check the version from CMD console :
C:\Users\xxxxx>**java -version**
java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
Problem JAVA_HOME and PATH environment viariables are JDK8u151 ???
To solve the problem, the documentation advice that :
Alternatively, you can specifically set the Java path with the AS_JAVA property in the in the as-install/config/asenv.conf file.
C:\DEVENV\glassfish5\glassfish\config>dir
Le volume dans le lecteur C s’appelle OS
Le numéro de série du volume est 10BF-2BBE
Répertoire de C:\DEVENV\glassfish5\glassfish\config
08/09/2017 07:27 <DIR> .
08/09/2017 07:27 <DIR> ..
12/01/2018 17:44 3 516 asenv.bat
...
Consequently, I add the last line below :
set AS_IMQ_LIB=..\..\mq\lib
set AS_IMQ_BIN=..\..\mq\bin
set AS_CONFIG=..\config
set AS_INSTALL=..
set AS_DEF_DOMAINS_PATH=..\domains
set AS_DEF_NODES_PATH=..\nodes
set AS_DERBY_INSTALL=..\..\javadb
**set AS_JAVA=C:\Program Files\Java\jdk1.8.0_151**
Relaunch CMD console and start server with asadmin start-domain : it works properly....enjoy.
As mentioned above GlassFish 5.0 leverages new features in Java SE 8,
and is certified today on Java SE 8. Even though we have a lot of work
in front of us with the transition to the Eclipse Foundation, our
current intent is to certify Java SE 9 in an upcoming GlassFish 5
release.
JDK 9 should be supported in the next update, i.e. GlassFish 5.0.1
See end of https://blogs.oracle.com/theaquarium/java-ee-8-is-final-and-glassfish-50-is-released
If you are on a mac or linux machine, add the following to config/asenv.conf in your glassfish installation directory.
set AS_JAVA="path to your jdk 8"
For example, in Mac OS it will be
AS_JAVA="/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home"
Anyone having problems with NullPointerException, look out for your system PATH Variables. Be sure that they point to an acceptable JDK (As it was said before: GlassFish 5.0 is certified only to work on JDK 8u144). This NullPointerException is caused by using an incompartible JDK as mentioned here: https://docs.oracle.com/cd/E19226-01/820-7688/gipqi/index.html
In my case the PATH variable was correctly pointing to java8u144 bin, but my PATH also contained a pointer to C:\ProgramData\Oracle\Java\javapath. And someway an old version of java SDK was stored on \ProgramData\Oracle so GlassFish was using this old version of java as SDK.

Java 1.7 or later is required to run Apache Drill

When I type
$ drillbit.sh start
it shows me this error:
ERROR: Java 1.7 or later is required to run Apache Drill.
although I have the latest version of java
$ java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
also my $JAVA_HOME is set correctly in .profile
What could cause such issue?
Well, after investgating a little bit I have found that the config file drill-config.sh
checks the java version with bad regex:
"$JAVA" -version 2>&1 | grep "version" | egrep -e "1.4|1.5|1.6" > /dev/null
if [ $? -eq 0 ]; then
fatal_error "Java 1.7 or later is required to run Apache Drill."
fi
The regex "1.4" matches 144 which is the update number in java version I have.
So the floating point should be escaped to be "1\.4"
And this finally solved my problem.
There is already a Jira to fix this:
https://issues.apache.org/jira/browse/DRILL-5698 and open PR.

require java false for jRuby osx

I have installed jRuby. I don't know what's the issue have. I installed jRuby with rbenv on OSX.
echo $JAVA_HOME has not output
❯ rbenv versions
system
1.9.3-p125
* 2.2.3 (set by /usr/local/var/rbenv/version)
jruby-9.0.5.0
~
❯ java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
~
❯ rbenv shell jruby-9.0.5.0
~
❯ rbenv version
jruby-9.0.5.0 (set by RBENV_VERSION environment variable)
~
❯ ruby -v
jruby 9.0.5.0 (2.2.3) 2016-01-26 7bee00d Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [darwin-x86_64]
~
❯ jirb
irb(main):001:0> require 'java'
=> false
irb(main):002:0>
you are using JRuby require 'java' would have raised an error on MRI
ruby -v output confirms that a JVM was found (no need for JAVA_HOME)

JSON/RPC/Client.pm Missing - Fedora 17

I want to run a JSON request using Zabbix API, but I get the following error:
Can't locate JSON/RPC/Client.pm in #INC (#INC contains: /usr/local/lib64/perl5
/usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl
/usr/lib64/perl5 /usr/share/perl5 .) at ./test.perl line 6.
I'am using Fedora 17 and don't find the package named: libjson-rpc-perl. I've already installed the following packages:
perl-CGI-Application-Plugin-JSON.noarch 1.02- 5.fc17 fedora
perl-Catalyst-View-JSON.noarch 0.30-5.fc17 fedora
perl-JSON-Any.noarch 1.29-1.fc17 fedora
perl-JSON-Any-tests.noarch 1.29-1.fc17 fedora
perl-JSON-PP.noarch 2.27200-3.fc17 fedora
perl-JSON-Path.noarch 0.101-2.fc17 fedora
perl-JSON-RPC-Daemon.noarch 1.03-2.fc17 updates
perl-JSON-RPC-legacy.noarch 1.01-2.fc17 fedora
perl-JSON-RPC-legacy-server.noarch 1.01-2.fc17 fedora
perl-JSON-Util.noarch 0.05-3.fc17 fedora
perl-JSON-XS.x86_64 1:2.32-1.fc17 fedora
perl-JSON-XS-tests.x86_64 1:2.32-1.fc17 fedora
perl-JSON-tests.noarch 2.53-4.fc17 fedora
perl-MooseX-Types-JSON.noarch 0.02-7.fc17 fedora
perl-MooseX-Types-JSON-tests.noarch 0.02-7.fc17 fedora
perl-Test-CPAN-Meta-JSON.noarch 0.13-1.fc17 fedora
perl-Test-JSON.noarch 0.11-6.fc17 fedora
perl-Test-JSON-tests.noarch 0.11-6.fc17 fedora
I don't know what to do now ? Can you please advice ?
Thanks in advance,
in your code :
use JSON::RPC::Legacy::Client;
and also change:
my $client = new JSON::RPC::Legacy::Client;
Use CPAN to install JSON::RPC. It's usually simple procedure. There is also a tool somewhere that converts CPAN distributions into rpms, but you might find cpan easier to handle without additional conversion step.
In general, in Fedora (and anywhere else in the Red Hat world), if you don't know which package contains the module you need, you can run:
% yum install 'perl(Module::Name)'
In this case, that would be:
% yum install 'perl(JSON::RPC::Client)'
JSON::RPC::Client was provided by an older version of JSON-RPC. Version 1.00 of JSON-RPC broke backwards compatibility with previous releases and no longer includes that module. You'd have to install the older version to get this code to work (or update the code to use the new API). You can get JSON-RPC 0.96 (the last compatible version) here.
You can install the old version in a private location just for this code.

Categories