FELIX-2310: Karaf framework environment is not set correctly
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@952610 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/karaf/admin/core/src/main/java/org/apache/felix/karaf/admin/internal/InstanceImpl.java b/karaf/admin/core/src/main/java/org/apache/felix/karaf/admin/internal/InstanceImpl.java
index 45d59d3..ed27f4a 100644
--- a/karaf/admin/core/src/main/java/org/apache/felix/karaf/admin/internal/InstanceImpl.java
+++ b/karaf/admin/core/src/main/java/org/apache/felix/karaf/admin/internal/InstanceImpl.java
@@ -163,8 +163,8 @@
String command = new File(System.getProperty("java.home"), ScriptUtils.isWindows() ? "bin\\java.exe" : "bin/java").getCanonicalPath()
+ " " + javaOpts
+ " -Djava.util.logging.config.file=\"" + new File(location, "etc/java.util.logging.properties").getCanonicalPath() + "\""
- + " -Djava.endorsed.dirs=\"" + new File(new File(System.getProperty("java.home"), "lib"), "endorsed") + System.getProperty("path.separator") + new File(libDir, "endorsed").getCanonicalPath() + "\""
- + " -Djava.ext.dirs=\"" + new File(new File(System.getProperty("java.home"), "lib"), "ext") + System.getProperty("path.separator") + new File(libDir, "ext").getCanonicalPath() + "\""
+ + " -Djava.endorsed.dirs=\"" + new File(new File(new File(System.getProperty("java.home"), "jre"), "lib"), "endorsed") + System.getProperty("path.separator") + new File(new File(System.getProperty("java.home"), "lib"), "endorsed") + System.getProperty("path.separator") + new File(libDir, "endorsed").getCanonicalPath() + "\""
+ + " -Djava.ext.dirs=\"" + new File(new File(new File(System.getProperty("java.home"), "jre"), "lib"), "ext") + System.getProperty("path.separator") + new File(new File(System.getProperty("java.home"), "lib"), "ext") + System.getProperty("path.separator") + new File(libDir, "ext").getCanonicalPath() + "\""
+ " -Dkaraf.home=\"" + System.getProperty("karaf.home") + "\""
+ " -Dkaraf.base=\"" + new File(location).getCanonicalPath() + "\""
+ " -Dkaraf.startLocalConsole=false"
diff --git a/karaf/assembly/src/main/distribution/unix-shell/bin/karaf b/karaf/assembly/src/main/distribution/unix-shell/bin/karaf
index 997966e..97a68ae 100755
--- a/karaf/assembly/src/main/distribution/unix-shell/bin/karaf
+++ b/karaf/assembly/src/main/distribution/unix-shell/bin/karaf
@@ -315,7 +315,7 @@
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
fi
cd $KARAF_BASE
- exec $JAVA $JAVA_OPTS -Djava.endorsed.dirs="${JAVA_HOME}/lib/endorsed:${KARAF_HOME}/lib/endorsed" -Djava.ext.dirs="${JAVA_HOME}/lib/ext:${KARAF_HOME}/lib/ext" -Dstorage.location="${KARAF_HOME}/instances" -Dkaraf.home="$KARAF_HOME" -Dkaraf.base="$KARAF_BASE" -Djava.util.logging.config.file=$KARAF_BASE/etc/java.util.logging.properties $OPTS -classpath "$CLASSPATH" $MAIN "$@"
+ exec $JAVA $JAVA_OPTS -Djava.endorsed.dirs="${JAVA_HOME}/jre/lib/endorsed:${JAVA_HOME}/lib/endorsed:${KARAF_HOME}/lib/endorsed" -Djava.ext.dirs="${JAVA_HOME}/jre/lib/ext:${JAVA_HOME}/lib/ext:${KARAF_HOME}/lib/ext" -Dstorage.location="${KARAF_HOME}/instances" -Dkaraf.home="$KARAF_HOME" -Dkaraf.base="$KARAF_BASE" -Djava.util.logging.config.file=$KARAF_BASE/etc/java.util.logging.properties $OPTS -classpath "$CLASSPATH" $MAIN "$@"
}
main() {
diff --git a/karaf/assembly/src/main/distribution/windows-text/bin/karaf.bat b/karaf/assembly/src/main/distribution/windows-text/bin/karaf.bat
index 298c1e6..40ce239 100755
--- a/karaf/assembly/src/main/distribution/windows-text/bin/karaf.bat
+++ b/karaf/assembly/src/main/distribution/windows-text/bin/karaf.bat
@@ -228,7 +228,7 @@
if not "%SHIFT%" == "true" SET ARGS=%1 %2 %3 %4 %5 %6 %7 %8
rem Execute the Java Virtual Machine
cd %KARAF_BASE%
- "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Djava.endorsed.dirs="%JAVA_HOME%\lib\endorsed;%KARAF_HOME%\lib\endorsed" -Djava.ext.dirs="%JAVA_HOME%\lib\ext;%KARAF_HOME%\lib\ext" -Dstorage.location="%KARAF_HOME%\instances" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" %MAIN% %ARGS%
+ "%JAVA%" %JAVA_OPTS% %OPTS% -classpath "%CLASSPATH%" -Djava.endorsed.dirs="%JAVA_HOME%\jre\lib\endorsed;%JAVA_HOME%\lib\endorsed;%KARAF_HOME%\lib\endorsed" -Djava.ext.dirs="%JAVA_HOME%\jre\lib\ext;%JAVA_HOME%\lib\ext;%KARAF_HOME%\lib\ext" -Dstorage.location="%KARAF_HOME%\instances" -Dkaraf.home="%KARAF_HOME%" -Dkaraf.base="%KARAF_BASE%" -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" %MAIN% %ARGS%
rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
diff --git a/karaf/shell/wrapper/src/main/resources/org/apache/felix/karaf/shell/wrapper/unix/karaf-wrapper.conf b/karaf/shell/wrapper/src/main/resources/org/apache/felix/karaf/shell/wrapper/unix/karaf-wrapper.conf
index 7410ada..2ef29cb 100644
--- a/karaf/shell/wrapper/src/main/resources/org/apache/felix/karaf/shell/wrapper/unix/karaf-wrapper.conf
+++ b/karaf/shell/wrapper/src/main/resources/org/apache/felix/karaf/shell/wrapper/unix/karaf-wrapper.conf
@@ -40,8 +40,8 @@
wrapper.java.additional.3=-Dcom.sun.management.jmxremote
wrapper.java.additional.4=-Dkaraf.startLocalConsole=false
wrapper.java.additional.5=-Dkaraf.startRemoteShell=true
-wrapper.java.additional.6=-Djava.endorsed.dirs="%JAVA_HOME%/lib/endorsed;%KARAF_HOME%/lib/endorsed"
-wrapper.java.additional.7=-Djava.ext.dirs="%JAVA_HOME%/lib/ext;%KARAF_HOME%/lib/ext"
+wrapper.java.additional.6=-Djava.endorsed.dirs="%JAVA_HOME%/jre/lib/endorsed;%JAVA_HOME%/lib/endorsed;%KARAF_HOME%/lib/endorsed"
+wrapper.java.additional.7=-Djava.ext.dirs="%JAVA_HOME%/jre/lib/ext;%JAVA_HOME%/lib/ext;%KARAF_HOME%/lib/ext"
# Uncomment to enable jmx
#wrapper.java.additional.n=-Dcom.sun.management.jmxremote.port=1616
diff --git a/karaf/shell/wrapper/src/main/resources/org/apache/felix/karaf/shell/wrapper/windows/karaf-wrapper.conf b/karaf/shell/wrapper/src/main/resources/org/apache/felix/karaf/shell/wrapper/windows/karaf-wrapper.conf
index 7347b76..196beff 100644
--- a/karaf/shell/wrapper/src/main/resources/org/apache/felix/karaf/shell/wrapper/windows/karaf-wrapper.conf
+++ b/karaf/shell/wrapper/src/main/resources/org/apache/felix/karaf/shell/wrapper/windows/karaf-wrapper.conf
@@ -40,8 +40,8 @@
wrapper.java.additional.3=-Dcom.sun.management.jmxremote
wrapper.java.additional.4=-Dkaraf.startLocalConsole=false
wrapper.java.additional.5=-Dkaraf.startRemoteShell=true
-wrapper.java.additional.6=-Djava.endorsed.dirs="%JAVA_HOME%/lib/endorsed;%KARAF_HOME%/lib/endorsed"
-wrapper.java.additional.7=-Djava.ext.dirs="%JAVA_HOME%/lib/ext;%KARAF_HOME%/lib/ext"
+wrapper.java.additional.6=-Djava.endorsed.dirs="%JAVA_HOME%/jre/lib/endorsed;%JAVA_HOME%/lib/endorsed;%KARAF_HOME%/lib/endorsed"
+wrapper.java.additional.7=-Djava.ext.dirs="%JAVA_HOME%/jre/lib/ext;%JAVA_HOME%/lib/ext;%KARAF_HOME%/lib/ext"
# Uncomment to enable jmx
#wrapper.java.additional.n=-Dcom.sun.management.jmxremote.port=1616