[jruby] Finding out Java version

Karol Bucek self at kares.org
Wed Jul 5 20:17:49 JST 2017


Java is already loaded by default since 1.7 ... no need to `require 'java'`
although it makes the intent clearer.

Have you thought about asking simple JRuby stuff on stack-overflow ?
An answer can score some points and other users dealing with the same issue
will benefit - as its more likely to be indexed by Google.

K.

On Wed, Jul 5, 2017 at 1:10 PM, <changepoint_advi.fischer at extaccount.com>
wrote:

> Aaaaah, thank you. This suits much better.
>
>
>
> Ronald
>
>
>
> *Von:* JRuby [mailto:jruby-bounces at ruby-lang.org] *Im Auftrag von *
> christian
> *Gesendet:* Mittwoch, 5. Juli 2017 13:06
>
> *An:* JRuby project mailing list <jruby at ruby-lang.org>
> *Betreff:* Re: [jruby] Finding out Java version
>
>
>
> ENV_JAVA['java.version']
>
>
>
> On Wed, Jul 5, 2017 at 1:05 PM, <changepoint_advi.fischer at extaccount.com>
> wrote:
>
> I see …. So, no chance to get it without doing a
>
>
>
>    require ‘java’.
>
>
>
> I had hoped that there would be a constant already available. Thanks a lot.
>
>
>
> *Von:* JRuby [mailto:jruby-bounces at ruby-lang.org] *Im Auftrag von *Christian
> MICHON
> *Gesendet:* Mittwoch, 5. Juli 2017 12:58
> *An:* JRuby project mailing list <jruby at ruby-lang.org>
> *Betreff:* Re: [jruby] Finding out Java version
>
>
>
> From cmd line:
> $ jruby -v
>
> $ java -version
>
> From ruby script:
>
> require 'java'
> Java::JavaLang::System.getProperty 'java.version'
>
>
>
> On Wed, Jul 5, 2017 at 12:37 PM, <changepoint_advi.fischer at extaccount.com>
> wrote:
>
> I know that I can find the Jruby version from within a JRuby program by
>
> JRUBY_VERSION
>
> Is there also a way to get the version of the Java Virtual Machine I'm
> running on?
>
> Ronald
>
> If you are not the addressee, please inform us immediately that you have
> received this e-mail by mistake, and delete it. We thank you for your
> support.
>
>
>
>
> If you are not the addressee, please inform us immediately that you have
> received this e-mail by mistake, and delete it. We thank you for your
> support.
>
>
>
> If you are not the addressee, please inform us immediately that you have
> received this e-mail by mistake, and delete it. We thank you for your
> support.
>
>


-- 
[ Karol Bucek ]( *http://kares.org <http://kares.org>* )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ruby-lang.org/pipermail/jruby/attachments/20170705/89c3e8c3/attachment.html>


More information about the JRuby mailing list