Method: Mongo::Server::AppMetadata::Platform#java_version

Defined in:
lib/mongo/server/app_metadata/platform.rb

#java_versionString | nil

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the version of the current Java environment, or nil if not invoked with JRuby.

Returns:

  • (String | nil)

    the current Java version

Since:

  • 2.0.0



68
69
70
71
72
# File 'lib/mongo/server/app_metadata/platform.rb', line 68

def java_version
  return nil unless jruby?

  java.lang.System.get_property('java.version')
end