Jruby -v failing with possible Java version issue

Hello team,

I installed jruby 1.6.1, as fully described below.
When I run the jruby -v command, it fails. Please see output at the
end of
this post.

Downloaded file:
jruby-bin-1.6.1.tar

When I verify Java on the Oracle site, I get the following:

    Your Java is Working
    Java update available

    Your Java configuration is as follows:

Vendor: IBM Corporation http://java.com/
Version: Java SE 6
Operating System: Linux 2.6.32-71.24.1.el6.x86_64
Architecture: amd64
*
*
*
*
root@myserver # /opt/jruby -ls -l
-rw-r–r-- 1 root root 1799 Apr 12 12:23 README
-rw-r–r-- 1 root root 2572 Apr 12 12:23 LICENSE.RUBY
-rw-r–r-- 1 root root 113210 Apr 12 12:23 COPYING
drwxr-xr-x 2 root root 4096 Apr 12 12:26 bin
drwxr-xr-x 6 root root 4096 May 12 08:20 samples
drwxr-xr-x 4 root root 4096 May 12 08:20 lib
drwxr-xr-x 5 root root 4096 May 12 08:20 docs
drwxr-xr-x 3 root root 4096 May 12 08:20 tool
drwxr-xr-x 3 root root 4096 May 12 08:20 share
drwxr-xr-x 2 root root 4096 May 12 08:22 jruby-1.6.1

root@myserver # echo $PATH
/sbin:/usr/sbin:/usr/local/sbin:/opt/gnome/sbin:/root/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib64/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:
/opt/jruby/bin
:/usr/local/bin:/usr/local/sbin:/suptools/bin:.:/opt/jruby/bin

When I try jruby -v, this is what I get:

root@myserver # jruby -v
JVMJ9VM007E Command-line option unrecognised: -client
Could not create the Java virtual machine.

Usage: java [-options] class [args…]
(to execute a class)
or java [-jar] [-options] jarfile [args…]
(to execute a jar file)

where options include:
-cp -classpath <directories and zip/jar files separated by :>
set search path for application classes and resources
-D=
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version
-showversion print product version and continue
-? -help print this help message
-X print help on non-standard options
-assert print help on assert options

Any help will be appreciated!

Thank you

On Fri, 13 May 2011, Ruby S. wrote:

Hello team,

I installed jruby 1.6.1, as fully described below.
When I run the jruby -v command, it fails. Please see output at the end of
this post.

I dug into this a few months ago. It looks like the IBM implementation
of
Java doesn’t support the “-client” command line switch. I wound up
switching to a different version of Java.

– Matt
It’s not what I know that counts.
It’s what I can remember in time to use.

On Fri, 13 May 2011, Ruby S. wrote:

   Your Java is Working
   Java update available

   Your Java configuration is as follows:

Vendor: IBM Corporation http://java.com/
Version: Java SE 6
Operating System: Linux 2.6.32-71.24.1.el6.x86_64
Architecture: amd64

I’m not sure if the IBM Java supports all the flags which Sun/Oracle
java
supports.

root@myserver # echo $PATH

/sbin:/usr/sbin:/usr/local/sbin:/opt/gnome/sbin:/root/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib64/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:

/opt/jruby/bin
:/usr/local/bin:/usr/local/sbin:/suptools/bin:.:/opt/jruby/bin

Your path looks really weird here.

Also, I think that jruby requires the jdk, not the jre.

When I try jruby -v, this is what I get:

root@myserver # jruby -v
JVMJ9VM007E Command-line option unrecognised: -client
Could not create the Java virtual machine.

try a

which java

and a

java -version

But I do believe there’s an issue with IBM’s java version.

Matt

Hi,

This is the output of the commands suggested:

root@myserver # which java
/usr/bin/java

root@myserver # java -version
java version “1.4.2”
Java™ 2 Runtime Environment, Standard Edition (build 2.2)
IBM J9SE VM (build 2.2, J2RE 1.4.2 IBM J9 2.2 Linux amd64-64
j9xa64142-20061124 (JIT enabled)
J9VM - 20061121_1035_LHdSMr
JIT - r7_level20061020_1803)

My path:

root@myserver # echo $PATH
/sbin:/usr/sbin:/usr/local/sbin:/opt/gnome/sbin:/root/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib64/jvm/jre/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:/opt/jruby/bin:/usr/local/bin:/usr/local/sbin:/suptools/bin:.

Thank you

On Fri, 13 May 2011, Ruby S. wrote:

IBM J9SE VM (build 2.2, J2RE 1.4.2 IBM J9 2.2 Linux amd64-64
j9xa64142-20061124 (JIT enabled)
J9VM - 20061121_1035_LHdSMr
JIT - r7_level20061020_1803)

1.4.2 won’t work. You need java 1.6. FWiW, Java 1.4 was sunsetted a
number of years ago. 1.5 was sunset in 2009, I believe.

And IBM Java won’t work.

Matt

On Thu, May 12, 2011 at 9:39 PM, Ruby S. [email protected]
wrote:

Perhaps, like you said, I have to switch from IBM to Oracle version.
I don’t want to remove the IBM version since it might be used by some
application on the server, but I am wondering if I can have multiple Java
versions from different vendors.

Yes, you can. Just make sure to install OpenJRE/OpenJDK to its own
directory, and specify this version whenever you want to use JRuby.

Then, you can test if the Oracle version makes any of your other apps
fail, before migrating over (if you want to).

You should also post JRuby specific questions one mailinglist over on
JRuby-user. There’s the experts who can help you with both Java and
JRuby issues. :slight_smile:


Phillip G.

Though the folk I have met,
(Ah, how soon!) they forget
When I’ve moved on to some other place,
There may be one or two,
When I’ve played and passed through,
Who’ll remember my song or my face.

But I have 1.6, I installed it.
If I go to the Oracle site and run their applet to verify the java
version,
I get the following:

When I verify Java on the Oracle site, I get the following:

    Your Java is Working
    Java update available

    Your Java configuration is as follows:

Vendor: IBM Corporation http://java.com/
Version: Java SE 6
Operating System: Linux 2.6.32-71.24.1.el6.x86_64
Architecture: amd64

Perhaps, like you said, I have to switch from IBM to Oracle version.
I don’t want to remove the IBM version since it might be used by some
application on the server, but I am wondering if I can have multiple
Java
versions from different vendors.

Thank you

OK gents, I installed Java 1.6 and pointed to it via the JAVA_HOME
environmental variable. It looks like it worked.

jruby -v
jruby 1.6.1 (ruby-1.8.7-p330) (2011-04-12 85838f6) (Java HotSpot™
64-Bit
Server VM 1.6.0_25) [linux-amd64-java]

Thank you for your help!

On Fri, May 13, 2011 at 12:51 PM, Ruby S. [email protected]
wrote:

OK gents, I installed Java 1.6 and pointed to it via the JAVA_HOME
environmental variable. It looks like it worked.

jruby -v
jruby 1.6.1 (ruby-1.8.7-p330) (2011-04-12 85838f6) (Java HotSpot™ 64-Bit
Server VM 1.6.0_25) [linux-amd64-java]

Thank you for your help!

Just saw this thread today…

If you (or anyone else) need to use IBM JDK and get that “-client”
error, you can pass “–noclient” to JRuby to disable that flag.
Normally we pass -client to the JVM because on Hotspot/OpenJDK (by far
the most widely used) it helps startup time a lot. Unfortunately it’s
not a standard flag.

  • Charlie

On Fri, 13 May 2011, Ruby S. wrote:

But I have 1.6, I installed it.

That may be the case, however, when you ran java -version, it says 1.4.2

So that’s the one which is first in your path.

Vendor: IBM Corporation http://java.com/
Version: Java SE 6
Operating System: Linux 2.6.32-71.24.1.el6.x86_64
Architecture: amd64

How are you verifying this??? Via a browser or an applet? That does
not
necessarily count.

Perhaps, like you said, I have to switch from IBM to Oracle version.
I don’t want to remove the IBM version since it might be used by some
application on the server, but I am wondering if I can have multiple Java
versions from different vendors.

Yes, you can. It is controlled by your path. Just make sure that the
version you want to use comes first in the path.

Matt

Charlie,

Thank you for the info. I am sure it will become useful.

Thanks again,

On Sat, May 14, 2011 at 7:11 PM, Charles Oliver N.