Can't launch Elasticsearch

My JAVA_HOME code in .profile

export JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH

And when I try to launch:

[elasticsearch-7.11.1] ./bin/elasticsearch Exception in thread "main" java.lang.RuntimeException: starting java failed with [1] output: [0.001s][error][logging] Error opening log file 'logs/gc.log': Permission denied [0.001s][error][logging] Initialization of output 'file=logs/gc.log' using options 'filecount=32,filesize=64m' failed. error: Could not rename log file 'logs/gc.log' to 'logs/gc.log.01' (Permission denied). Invalid -Xlog option '-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m', see error log for details. Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. at org.elasticsearch.tools.launchers.JvmOption.flagsFinal(JvmOption.java:119) at org.elasticsearch.tools.launchers.JvmOption.findFinalOptions(JvmOption.java:81) at org.elasticsearch.tools.launchers.JvmErgonomics.choose(JvmErgonomics.java:38) at org.elasticsearch.tools.launchers.JvmOptionsParser.jvmOptions(JvmOptionsParser.java:135) at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:86) [elasticsearch-7.11.1]

I did sudo chmod 777 on the Java home directory.

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