javaapache-karaf

Karaf and java_home


Is there a way to set the default java path for karaf without using the JAVA_HOME environment variable?

E.g. one of the settings files?

I have another application that requires the JAVA_HOME variable set to a diffrent version of jre and can't repoint the path for this.

Karaf is currently being run as a Windows service and the console is accessed via client.bat


Solution

  • You mentioned you are are running karaf as Windows service, so I guess you are using Wrapper
    In the Wrapper configuration file change the default JRE/JDK path and restart your karaf application.

    #********************************************************************
    # Wrapper Properties
    #********************************************************************
    set.default.JAVA_HOME=C:\Program Files\Zulu\zulu-8\