6729469: Multiple jar files specified in the classpath in Makefile needs quotation on Windows
authormchung
Thu Jul 24 08:41:30 2008 -0700 (16 months ago)
changeset 423594b22f33ae5
parent 42263e210f7db01
child 4242cc8f34251ff
6729469: Multiple jar files specified in the classpath in Makefile needs quotation on Windows
Summary: Added quotation around the classpath argument in sun/module/osgi/Makefile
Reviewed-by: stanleyh, ksrini
make/sun/module/osgi/Makefile
src/share/classes/sun/module/osgi/OSGiRuntime.java
--- a/make/sun/module/osgi/Makefile Tue Jul 22 23:22:36 2008 -0700
+++ b/make/sun/module/osgi/Makefile Thu Jul 24 08:41:30 2008 -0700
@@ -39,10 +39,10 @@ ifndef OPENJDK
# if OSGI_FRAMEWORK_JAR and FELIX_JAR are set
MODULES_LIB = $(CLOSED_SHARE_SRC)/lib/module
ifndef OSGI_FRAMEWORK_JAR
- OSGI_FRAMEWORK_JAR = $(MODULES_LIB)/org.osgi.core-1.0.1.jar
+ OSGI_FRAMEWORK_JAR = "$(MODULES_LIB)/org.osgi.core-1.0.1.jar"
endif
ifndef FELIX_JAR
- FELIX_JAR = $(MODULES_LIB)/felix.jar
+ FELIX_JAR = "$(MODULES_LIB)/felix.jar"
endif
endif
@@ -61,11 +61,7 @@ ifdef OSGI_FRAMEWORK_JAR
#
# Temporary workaround to include the OSGi framework
# and Felix OSGi container for compilation.
-ifeq ($(PLATFORM),windows)
- OTHER_JAVACFLAGS = -cp $(OSGI_FRAMEWORK_JAR);$(FELIX_JAR)
-else # PLATFORM
- OTHER_JAVACFLAGS = -cp $(OSGI_FRAMEWORK_JAR):$(FELIX_JAR)
-endif
+ OTHER_JAVACFLAGS = -cp "$(OSGI_FRAMEWORK_JAR)$(CLASSPATH_SEPARATOR)$(FELIX_JAR)"
endif
--- a/src/share/classes/sun/module/osgi/OSGiRuntime.java Tue Jul 22 23:22:36 2008 -0700
+++ b/src/share/classes/sun/module/osgi/OSGiRuntime.java Thu Jul 24 08:41:30 2008 -0700
@@ -75,6 +75,9 @@ class OSGiRuntime implements BundleActiv
private BundleContext context = null;
private PackageAdmin packageAdmin = null;
+
+ // Default system property to configure the directory for OSGi bundle caching
+ private static final String CACHE_DIR_PROP = "java.module.osgi.repository.cache";
private OSGiRuntime() {
}
@@ -125,10 +128,11 @@ class OSGiRuntime implements BundleActiv
// Get the path of the felix.jar file.
String jarLocation = classpath.substring(start, index + 9);
container = new File(jarLocation);
- } else {
- // No OSGi container
- throw new IOException("Felix container doesn't exist");
- }
+ }
+ }
+ if (container == null || !container.exists()) {
+ // No OSGi container
+ throw new IOException("Felix container doesn't exist");
}
// Read configuration properties.
@@ -183,8 +187,13 @@ class OSGiRuntime implements BundleActiv
if ((profileName == null || profileName.length() == 0) &&
(profileDirName == null || profileDirName.length() == 0)) {
- throw new IOException("Fail to start the OSGi container: " +
- "Profile name or directory property is not specified");
+ String cacheDir = System.getProperty(CACHE_DIR_PROP);
+ if (cacheDir != null) {
+ configProps.setProperty(BundleCache.CACHE_PROFILE_DIR_PROP, cacheDir);
+ } else {
+ throw new IOException("Fail to start the OSGi container: " +
+ "Profile name or directory property is not specified");
+ }
}
// Configure the Felix instance to be embedded.