Logstash 8 cannot run with JRE

When I start logstash 8 with jre, it is failed , jdk is ok
Logstash 7 works fine with jre

logstash version:8.8.1
jre version: 11.0.18
testing configuration:

input{
stdin{}
}

output{
stdout{}
}

The error message is as follows

Using LS_JAVA_HOME defined java: /opt/cloud/3rdComponent/jre.
Sending Logstash logs to /opt/cloud/test/logstash-8.8.1/logs which is now configured via log4j2.properties
[2023-06-27T16:28:15,892][INFO ][logstash.runner          ] Log4j configuration path used is: /opt/cloud/test/logstash-8.8.1/config/log4j2.properties
[2023-06-27T16:28:15,895][WARN ][logstash.runner          ] The use of JAVA_HOME has been deprecated. Logstash 8.0 and later ignores JAVA_HOME and uses the bundled JDK. Running Logstash with the bundled JDK is recommended. The bundled JDK has been verified to work with each specific version of Logstash, and generally provides best performance and reliability. If you have compelling reasons for using your own JDK (organizational-specific compliance requirements, for example), you can configure LS_JAVA_HOME to use that version instead.
[2023-06-27T16:28:15,896][INFO ][logstash.runner          ] Starting Logstash {"logstash.version"=>"8.8.1", "jruby.version"=>"jruby 9.3.10.0 (2.6.8) 2023-02-01 107b2e6697 OpenJDK 64-Bit Server VM 11.0.18+10 on 11.0.18+10 +indy +jit [x86_64-linux]"}
[2023-06-27T16:28:15,898][INFO ][logstash.runner          ] JVM bootstrap flags: [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djruby.compile.invokedynamic=true, -XX:+HeapDumpOnOutOfMemoryError, -Djava.security.egd=file:/dev/urandom, -Dlog4j2.isThreadContextMapInheritable=true, -Djruby.regexp.interruptible=true, -Djdk.io.File.enableADS=true, --add-opens=java.base/java.security=ALL-UNNAMED, --add-opens=java.base/java.io=ALL-UNNAMED, --add-opens=java.base/java.nio.channels=ALL-UNNAMED, --add-opens=java.base/sun.nio.ch=ALL-UNNAMED, --add-opens=java.management/sun.management=ALL-UNNAMED]
[2023-06-27T16:28:16,069][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2023-06-27T16:28:16,320][INFO ][logstash.agent           ] Successfully started Logstash API endpoint {:port=>9600, :ssl_enabled=>false}
[2023-06-27T16:28:16,486][INFO ][org.reflections.Reflections] Reflections took 115 ms to scan 1 urls, producing 132 keys and 464 values
[2023-06-27T16:28:16,722][INFO ][logstash.javapipeline    ] Pipeline `main` is configured with `pipeline.ecs_compatibility: v8` setting. All plugins in this pipeline will default to `ecs_compatibility => v8` unless explicitly configured otherwise.
[2023-06-27T16:28:16,758][INFO ][logstash.javapipeline    ][main] Starting pipeline {:pipeline_id=>"main", "pipeline.workers"=>4, "pipeline.batch.size"=>125, "pipeline.batch.delay"=>50, "pipeline.max_inflight"=>500, "pipeline.sources"=>["/opt/cloud/test/logstash-8.8.1/test.conf"], :thread=>"#<Thread:0x10834be@/opt/cloud/test/logstash-8.8.1/logstash-core/lib/logstash/java_pipeline.rb:134 run>"}
[2023-06-27T16:28:16,830][FATAL][org.logstash.Logstash    ][main] uncaught error (in thread Ruby-0-Thread-10: /opt/cloud/test/logstash-8.8.1/logstash-core/lib/logstash/java_pipeline.rb:289)
java.lang.NoClassDefFoundError: com/sun/source/tree/Tree
	at org.logstash.config.ir.compiler.ComputeStepSyntaxElement.generateCode(org/logstash/config/ir/compiler/ComputeStepSyntaxElement.java:174) ~[logstash-core.jar:?]
	at org.logstash.config.ir.compiler.ComputeStepSyntaxElement.<init>(org/logstash/config/ir/compiler/ComputeStepSyntaxElement.java:118) ~[logstash-core.jar:?]
	at org.logstash.config.ir.compiler.ComputeStepSyntaxElement.create(org/logstash/config/ir/compiler/ComputeStepSyntaxElement.java:89) ~[logstash-core.jar:?]
	at org.logstash.config.ir.compiler.DatasetCompiler.prepare(org/logstash/config/ir/compiler/DatasetCompiler.java:321) ~[logstash-core.jar:?]
	at org.logstash.config.ir.compiler.DatasetCompiler.compileOutput(org/logstash/config/ir/compiler/DatasetCompiler.java:427) ~[logstash-core.jar:?]
	at org.logstash.config.ir.compiler.DatasetCompiler.outputDataset(org/logstash/config/ir/compiler/DatasetCompiler.java:270) ~[logstash-core.jar:?]
	at org.logstash.config.ir.CompiledPipeline$CompiledExecution.outputDataset(org/logstash/config/ir/CompiledPipeline.java:457) ~[logstash-core.jar:?]
	at org.logstash.config.ir.CompiledPipeline$CompiledExecution.lambda$compileOutputs$3(org/logstash/config/ir/CompiledPipeline.java:417) ~[logstash-core.jar:?]
	at java.util.stream.ReferencePipeline$3$1.accept(java/util/stream/ReferencePipeline$3$1) ~[?:?]
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(java/util/ArrayList$ArrayListSpliterator) ~[?:?]
	at java.util.stream.AbstractPipeline.copyInto(java/util/stream/AbstractPipeline) ~[?:?]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(java/util/stream/AbstractPipeline) ~[?:?]
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(java/util/stream/ReduceOps$ReduceOp) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluate(java/util/stream/AbstractPipeline) ~[?:?]
	at java.util.stream.ReferencePipeline.collect(java/util/stream/ReferencePipeline) ~[?:?]
	at org.logstash.config.ir.CompiledPipeline$CompiledExecution.compileOutputs(org/logstash/config/ir/CompiledPipeline.java:418) ~[logstash-core.jar:?]
	at org.logstash.config.ir.CompiledPipeline$CompiledExecution.<init>(org/logstash/config/ir/CompiledPipeline.java:387) ~[logstash-core.jar:?]
	at org.logstash.config.ir.CompiledPipeline$CompiledUnorderedExecution.<init>(org/logstash/config/ir/CompiledPipeline.java:337) ~[logstash-core.jar:?]
	at org.logstash.config.ir.CompiledPipeline.buildExecution(org/logstash/config/ir/CompiledPipeline.java:156) ~[logstash-core.jar:?]
	at org.logstash.execution.WorkerLoop.<init>(org/logstash/execution/WorkerLoop.java:65) ~[logstash-core.jar:?]
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(jdk/internal/reflect/NativeConstructorAccessorImpl) ~[?:?]
	at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(jdk/internal/reflect/DelegatingConstructorAccessorImpl) ~[?:?]
	at java.lang.reflect.Constructor.newInstance(java/lang/reflect/Constructor) ~[?:?]
	at org.jruby.javasupport.JavaConstructor.newInstanceDirect(org/jruby/javasupport/JavaConstructor.java:237) ~[jruby.jar:?]
	at org.jruby.RubyClass.new(org/jruby/RubyClass.java:911) ~[jruby.jar:?]
	at org.jruby.RubyClass$INVOKER$i$newInstance.call(org/jruby/RubyClass$INVOKER$i$newInstance.gen) ~[jruby.jar:?]
	at RUBY.init_worker_loop(/opt/cloud/test/logstash-8.8.1/logstash-core/lib/logstash/java_pipeline.rb:583) ~[?:?]
	at RUBY.start_workers(/opt/cloud/test/logstash-8.8.1/logstash-core/lib/logstash/java_pipeline.rb:289) ~[?:?]
	at org.jruby.RubyProc.call(org/jruby/RubyProc.java:309) ~[jruby.jar:?]
	at java.lang.Thread.run(java/lang/Thread) [?:?]
Caused by: java.lang.ClassNotFoundException: com.sun.source.tree.Tree
	at jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source) ~[?:?]
	at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source) ~[?:?]
	at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:?]
	at org.logstash.config.ir.compiler.ComputeStepSyntaxElement.generateCode(ComputeStepSyntaxElement.java:174) ~[logstash-core.jar:?]
	at org.logstash.config.ir.compiler.ComputeStepSyntaxElement.<init>(ComputeStepSyntaxElement.java:118) ~[logstash-core.jar:?]
	at org.logstash.config.ir.compiler.ComputeStepSyntaxElement.create(ComputeStepSyntaxElement.java:89) ~[logstash-core.jar:?]
	at org.logstash.config.ir.compiler.DatasetCompiler.prepare(DatasetCompiler.java:321) ~[logstash-core.jar:?]
	at org.logstash.config.ir.compiler.DatasetCompiler.compileOutput(DatasetCompiler.java:427) ~[logstash-core.jar:?]
	at org.logstash.config.ir.compiler.DatasetCompiler.outputDataset(DatasetCompiler.java:270) ~[logstash-core.jar:?]
	at org.logstash.config.ir.CompiledPipeline$CompiledExecution.outputDataset(CompiledPipeline.java:457) ~[logstash-core.jar:?]
	at org.logstash.config.ir.CompiledPipeline$CompiledExecution.lambda$compileOutputs$3(CompiledPipeline.java:417) ~[logstash-core.jar:?]
	at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) ~[?:?]
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) ~[?:?]
	at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:?]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:?]
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(Unknown Source) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:?]
	at java.util.stream.ReferencePipeline.collect(Unknown Source) ~[?:?]
	at org.logstash.config.ir.CompiledPipeline$CompiledExecution.compileOutputs(CompiledPipeline.java:418) ~[logstash-core.jar:?]
	at org.logstash.config.ir.CompiledPipeline$CompiledExecution.<init>(CompiledPipeline.java:387) ~[logstash-core.jar:?]
	at org.logstash.config.ir.CompiledPipeline$CompiledUnorderedExecution.<init>(CompiledPipeline.java:337) ~[logstash-core.jar:?]
	at org.logstash.config.ir.CompiledPipeline.buildExecution(CompiledPipeline.java:156) ~[logstash-core.jar:?]
	at org.logstash.execution.WorkerLoop.<init>(WorkerLoop.java:65) ~[logstash-core.jar:?]
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:?]
	at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:?]
	at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:?]
	at org.jruby.javasupport.JavaConstructor.newInstanceDirect(JavaConstructor.java:237) ~[jruby.jar:?]
	at org.jruby.java.invokers.ConstructorInvoker.call(ConstructorInvoker.java:62) ~[jruby.jar:?]
	at org.jruby.java.invokers.ConstructorInvoker.call(ConstructorInvoker.java:140) ~[jruby.jar:?]
	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:329) ~[jruby.jar:?]
	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:87) ~[jruby.jar:?]
	at org.jruby.java.proxies.ConcreteJavaProxy$InitializeMethod.call(ConcreteJavaProxy.java:89) ~[jruby.jar:?]
	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:329) ~[jruby.jar:?]
	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:87) ~[jruby.jar:?]
	at org.jruby.RubyClass.newInstance(RubyClass.java:911) ~[jruby.jar:?]
	at org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen) ~[jruby.jar:?]
	at org.jruby.java.proxies.ConcreteJavaProxy$NewMethod.call(ConcreteJavaProxy.java:157) ~[jruby.jar:?]
	at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:329) ~[jruby.jar:?]
	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:87) ~[jruby.jar:?]
	at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:549) ~[jruby.jar:?]
	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:361) ~[jruby.jar:?]
	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[jruby.jar:?]
	at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:80) ~[jruby.jar:?]
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:164) ~[jruby.jar:?]
	at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:151) ~[jruby.jar:?]
	at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:210) ~[jruby.jar:?]
	at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:142) ~[jruby.jar:?]
	at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:345) ~[jruby.jar:?]
	at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) ~[jruby.jar:?]
	at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:116) ~[jruby.jar:?]
	at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:136) ~[jruby.jar:?]
	at org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:66) ~[jruby.jar:?]
	at org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:58) ~[jruby.jar:?]
	at org.jruby.runtime.Block.call(Block.java:143) ~[jruby.jar:?]
	at org.jruby.RubyProc.call(RubyProc.java:309) ~[jruby.jar:?]
	at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:107) ~[jruby.jar:?]
	at java.lang.Thread.run(Unknown Source) ~[?:?]

Hi @sxwnhxwx,

Thanks for flagging this! Do you mind raising a bug on the Logstash GitHub? I see you have specified LS_JAVA_HOME over JAVA_HOME as per the 8.x breaking change release notes, but I don't seen anything regarding changes to JRE support.

Hope that helps.

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