Change java path in config file


(DFrant) #1

Hello,

I would like to know in which file I can define the JAVA path in my logstash configuration because my JAVA_HOME is set to Java 7 and cannot be changed, to avoid that:

/usr/share/logstash/bin/logstash -e 'input { stdin {} } output { elasticsearch { hosts => ["10.0.228.41:9200]"} }'
NameError: cannot link Java class org.apache.logging.log4j.core.config.LoggerConfig needs Java 8 (java.lang.UnsupportedClassVersionError: org/logstash/log/LogstashLogEventFactory : Unsupported major.minor version 52.0)
  get_proxy_or_package_under_package at org/jruby/javasupport/JavaUtilities.java:54
                      method_missing at file:/usr/share/logstash/vendor/jruby/lib/jruby.jar!/jruby/java/java_package_module_template.rb:14
                             Logging at /usr/share/logstash/logstash-core/lib/logstash/logging/logger.rb:10
                            LogStash at /usr/share/logstash/logstash-core/lib/logstash/logging/logger.rb:5
                              (root) at /usr/share/logstash/logstash-core/lib/logstash/logging/logger.rb:4
                             require at org/jruby/RubyKernel.java:1040
                              (root) at /usr/share/logstash/logstash-core/lib/logstash/util/loggable.rb:1
                             require at org/jruby/RubyKernel.java:1040
                              (root) at /usr/share/logstash/logstash-core/lib/logstash/util/loggable.rb:2
                             require at org/jruby/RubyKernel.java:1040
                              (root) at /usr/share/logstash/logstash-core/lib/logstash/settings.rb:1
                             require at org/jruby/RubyKernel.java:1040
                              (root) at /usr/share/logstash/logstash-core/lib/logstash/settings.rb:2
                             require at org/jruby/RubyKernel.java:1040
                              (root) at /usr/share/logstash/lib/bootstrap/environment.rb:70

Thanks


(Magnus Bäck) #2

Why can't you change the JAVA_HOME variable just for the Logstash process?


(DFrant) #3

Because I run logstash in superuser, and my JAVA_HOME is already set with java 7 for some others processes.


(Magnus Bäck) #4

Yes, but that doesn't mean you can't set JAVA_HOME for the Logstash process.


(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.