Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2014-04-07 11:52:36 -0400
committerThomas Watson2014-04-11 17:45:43 -0400
commit741a4e64ee467423e97ff031656d683c18740e0f (patch)
treeb7b10414ca47fdf919fad3415112169e80e321ba
parent7950a2c2571dd2b64608b3473bff4ab421d65cb0 (diff)
downloadrt.equinox.framework-741a4e64ee467423e97ff031656d683c18740e0f.tar.gz
rt.equinox.framework-741a4e64ee467423e97ff031656d683c18740e0f.tar.xz
rt.equinox.framework-741a4e64ee467423e97ff031656d683c18740e0f.zip
Bug 432027 - Running on Java 8 compact1 profile
- Add new compact profiles for Java 8 embedded Change-Id: I3c851a7d30b71d3d36d6c9c04112bf6a506aa64f Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
-rw-r--r--bundles/org.eclipse.osgi/JavaSE-1.8.profile10
-rw-r--r--bundles/org.eclipse.osgi/JavaSE_compact1-1.8.profile37
-rw-r--r--bundles/org.eclipse.osgi/JavaSE_compact2-1.8.profile64
-rw-r--r--bundles/org.eclipse.osgi/JavaSE_compact3-1.8.profile98
-rw-r--r--bundles/org.eclipse.osgi/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.osgi/build.properties1
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java42
-rw-r--r--bundles/org.eclipse.osgi/profile.list3
8 files changed, 245 insertions, 12 deletions
diff --git a/bundles/org.eclipse.osgi/JavaSE-1.8.profile b/bundles/org.eclipse.osgi/JavaSE-1.8.profile
index 349d994d5..3db37e8fa 100644
--- a/bundles/org.eclipse.osgi/JavaSE-1.8.profile
+++ b/bundles/org.eclipse.osgi/JavaSE-1.8.profile
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2009, 2013 IBM Corporation and others.
+# Copyright (c) 2009, 2014 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -181,6 +181,9 @@ org.osgi.framework.executionenvironment = \
OSGi/Minimum-1.0,\
OSGi/Minimum-1.1,\
OSGi/Minimum-1.2,\
+ JavaSE/compact1-1.8,\
+ JavaSE/compact2-1.8,\
+ JavaSE/compact3-1.8,\
JRE-1.1,\
J2SE-1.2,\
J2SE-1.3,\
@@ -192,7 +195,10 @@ org.osgi.framework.executionenvironment = \
org.osgi.framework.system.capabilities = \
osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0, 1.1, 1.2",\
osgi.ee; osgi.ee="JRE"; version:List<Version>="1.0, 1.1",\
- osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8"
+ osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8",\
+ osgi.ee; osgi.ee="JavaSE/compact1"; version:List<Version>="1.8",\
+ osgi.ee; osgi.ee="JavaSE/compact2"; version:List<Version>="1.8",\
+ osgi.ee; osgi.ee="JavaSE/compact3"; version:List<Version>="1.8"
osgi.java.profile.name = JavaSE-1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.source=1.8
diff --git a/bundles/org.eclipse.osgi/JavaSE_compact1-1.8.profile b/bundles/org.eclipse.osgi/JavaSE_compact1-1.8.profile
new file mode 100644
index 000000000..757efcb96
--- /dev/null
+++ b/bundles/org.eclipse.osgi/JavaSE_compact1-1.8.profile
@@ -0,0 +1,37 @@
+###############################################################################
+# Copyright (c) 2014 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+org.osgi.framework.system.packages = \
+ javax.crypto.interfaces,\
+ javax.crypto.spec,\
+ javax.net,\
+ javax.net.ssl,\
+ javax.script,\
+ javax.security.auth,\
+ javax.security.auth.callback,\
+ javax.security.auth.login,\
+ javax.security.auth.spi,\
+ javax.security.auth.x500,\
+ javax.security.cert
+org.osgi.framework.executionenvironment = \
+ OSGi/Minimum-1.0,\
+ OSGi/Minimum-1.1,\
+ OSGi/Minimum-1.2,\
+ JavaSE/compact1-1.8
+org.osgi.framework.system.capabilities = \
+ osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0, 1.1, 1.2",\
+ osgi.ee; osgi.ee="JavaSE/compact1"; version:List<Version>="1.8"
+osgi.java.profile.name = JavaSE/compact1-1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
diff --git a/bundles/org.eclipse.osgi/JavaSE_compact2-1.8.profile b/bundles/org.eclipse.osgi/JavaSE_compact2-1.8.profile
new file mode 100644
index 000000000..bc6044b9c
--- /dev/null
+++ b/bundles/org.eclipse.osgi/JavaSE_compact2-1.8.profile
@@ -0,0 +1,64 @@
+###############################################################################
+# Copyright (c) 2014 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+org.osgi.framework.system.packages = \
+ javax.crypto.interfaces,\
+ javax.crypto.spec,\
+ javax.net,\
+ javax.net.ssl,\
+ javax.rmi.ssl,\
+ javax.script,\
+ javax.security.auth,\
+ javax.security.auth.callback,\
+ javax.security.auth.login,\
+ javax.security.auth.spi,\
+ javax.security.auth.x500,\
+ javax.security.cert,\
+ javax.sql,\
+ javax.transaction,\
+ javax.transaction.xa,\
+ javax.xml,\
+ javax.xml.datatype,\
+ javax.xml.namespace,\
+ javax.xml.parsers,\
+ javax.xml.stream,\
+ javax.xml.stream.events,\
+ javax.xml.stream.util,\
+ javax.xml.transform,\
+ javax.xml.transform.dom,\
+ javax.xml.transform.sax,\
+ javax.xml.transform.stax,\
+ javax.xml.transform.stream,\
+ javax.xml.validation,\
+ javax.xml.xpath,\
+ org.w3c.dom,\
+ org.w3c.dom.bootstrap,\
+ org.w3c.dom.events,\
+ org.w3c.dom.ls,\
+ org.xml.sax,\
+ org.xml.sax.ext,\
+ org.xml.sax.helpers
+org.osgi.framework.executionenvironment = \
+ OSGi/Minimum-1.0,\
+ OSGi/Minimum-1.1,\
+ OSGi/Minimum-1.2,\
+ JavaSE/compact1-1.8,\
+ JavaSE/compact2-1.8
+org.osgi.framework.system.capabilities = \
+ osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0, 1.1, 1.2",\
+ osgi.ee; osgi.ee="JavaSE/compact1"; version:List<Version>="1.8",\
+ osgi.ee; osgi.ee="JavaSE/compact2"; version:List<Version>="1.8"
+osgi.java.profile.name = JavaSE/compact2-1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
diff --git a/bundles/org.eclipse.osgi/JavaSE_compact3-1.8.profile b/bundles/org.eclipse.osgi/JavaSE_compact3-1.8.profile
new file mode 100644
index 000000000..05182dd23
--- /dev/null
+++ b/bundles/org.eclipse.osgi/JavaSE_compact3-1.8.profile
@@ -0,0 +1,98 @@
+###############################################################################
+# Copyright (c) 2014 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# IBM Corporation - initial API and implementation
+###############################################################################
+org.osgi.framework.system.packages = \
+ javax.annotation.processing,\
+ javax.crypto.interfaces,\
+ javax.crypto.spec,\
+ javax.lang.model,\
+ javax.lang.model.element,\
+ javax.lang.model.type,\
+ javax.lang.model.util,\
+ javax.management,\
+ javax.management.loading,\
+ javax.management.modelmbean,\
+ javax.management.monitor,\
+ javax.management.openmbean,\
+ javax.management.relation,\
+ javax.management.remote,\
+ javax.management.remote.rmi,\
+ javax.management.timer,\
+ javax.naming,\
+ javax.naming.directory,\
+ javax.naming.event,\
+ javax.naming.ldap,\
+ javax.naming.spi,\
+ javax.net,\
+ javax.net.ssl,\
+ javax.rmi.ssl,\
+ javax.script,\
+ javax.security.auth,\
+ javax.security.auth.kerberos,\
+ javax.security.auth.callback,\
+ javax.security.auth.login,\
+ javax.security.auth.spi,\
+ javax.security.auth.x500,\
+ javax.security.cert,\
+ javax.security.sasl,\
+ javax.sql,\
+ javax.sql.rowset,\
+ javax.sql.rowset.serial,\
+ javax.sql.rowset.spi,\
+ javax.tools,\
+ javax.transaction,\
+ javax.transaction.xa,\
+ javax.xml,\
+ javax.xml.crypto,\
+ javax.xml.crypto.dom,\
+ javax.xml.crypto.dsig,\
+ javax.xml.crypto.dsig.dom,\
+ javax.xml.crypto.dsig.keyinfo,\
+ javax.xml.crypto.dsig.spec,\
+ javax.xml.datatype,\
+ javax.xml.namespace,\
+ javax.xml.parsers,\
+ javax.xml.stream,\
+ javax.xml.stream.events,\
+ javax.xml.stream.util,\
+ javax.xml.transform,\
+ javax.xml.transform.dom,\
+ javax.xml.transform.sax,\
+ javax.xml.transform.stax,\
+ javax.xml.transform.stream,\
+ javax.xml.validation,\
+ javax.xml.xpath,\
+ org.ieft.jgss,\
+ org.w3c.dom,\
+ org.w3c.dom.bootstrap,\
+ org.w3c.dom.events,\
+ org.w3c.dom.ls,\
+ org.xml.sax,\
+ org.xml.sax.ext,\
+ org.xml.sax.helpers
+org.osgi.framework.executionenvironment = \
+ OSGi/Minimum-1.0,\
+ OSGi/Minimum-1.1,\
+ OSGi/Minimum-1.2,\
+ JavaSE/compact1-1.8,\
+ JavaSE/compact2-1.8,\
+ JavaSE/compact3-1.8
+org.osgi.framework.system.capabilities = \
+ osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0, 1.1, 1.2",\
+ osgi.ee; osgi.ee="JavaSE/compact1"; version:List<Version>="1.8",\
+ osgi.ee; osgi.ee="JavaSE/compact2"; version:List<Version>="1.8",\
+ osgi.ee; osgi.ee="JavaSE/compact3"; version:List<Version>="1.8"
+osgi.java.profile.name = JavaSE/compact3-1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.source=1.8
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
diff --git a/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF b/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF
index 9d36a6e9b..c668677ce 100644
--- a/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF
@@ -82,5 +82,5 @@ Bundle-DocUrl: http://www.eclipse.org
Eclipse-ExtensibleAPI: true
Eclipse-SystemBundle: true
Main-Class: org.eclipse.core.runtime.adaptor.EclipseStarter
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Capability: osgi.ee; filter:="(| (&(osgi.ee=JavaSE)(version=1.6)) (&(osgi.ee=JavaSE/compact1)(version=1.8)) )"
Eclipse-BundleShape: jar
diff --git a/bundles/org.eclipse.osgi/build.properties b/bundles/org.eclipse.osgi/build.properties
index d7eb3d8e9..aa117dc90 100644
--- a/bundles/org.eclipse.osgi/build.properties
+++ b/bundles/org.eclipse.osgi/build.properties
@@ -32,3 +32,4 @@ output.. = bin/
javacWarnings..=-deadCode,-raw,-unchecked
jars.extra.classpath = osgi/osgi.annotation.jar
+jre.compilation.profile = JavaSE-1.6
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java
index 0c258a3fd..a964a4ccf 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/storage/Storage.java
@@ -56,8 +56,8 @@ public class Storage {
public static final String DELETE_FLAG = ".delete"; //$NON-NLS-1$
public static final String LIB_TEMP = "libtemp"; //$NON-NLS-1$
- private static final String J2SE = "J2SE-"; //$NON-NLS-1$
- private static final String JAVASE = "JavaSE-"; //$NON-NLS-1$
+ private static final String J2SE = "J2SE"; //$NON-NLS-1$
+ private static final String JAVASE = "JavaSE"; //$NON-NLS-1$
private static final String PROFILE_EXT = ".profile"; //$NON-NLS-1$
private static final String NUL = new String(new byte[] {0});
@@ -1349,6 +1349,7 @@ public class Storage {
String vmProfile = null;
String javaEdition = null;
Version javaVersion = null;
+ String embeddedProfileName = "-"; //$NON-NLS-1$
if (j2meConfig != null && j2meConfig.length() > 0 && j2meProfiles != null && j2meProfiles.length() > 0) {
// save the vmProfile based off of the config and profile
// use the last profile; assuming that is the highest one
@@ -1381,7 +1382,26 @@ public class Storage {
} catch (IllegalArgumentException e) {
// do nothing
}
- vmProfile = javaEdition + javaSpecVersion;
+ // If javaSE 1.8 then check for release file for profile name.
+ Version v18 = new Version("1.8"); //$NON-NLS-1$
+ if (javaVersion != null && v18.compareTo(javaVersion) <= 0) {
+ String javaHome = System.getProperty("java.home"); //$NON-NLS-1$
+ if (javaHome != null) {
+ File release = new File(javaHome, "release"); //$NON-NLS-1$
+ if (release.exists()) {
+ Properties releaseProps = new Properties();
+ try {
+ releaseProps.load(new FileInputStream(release));
+ if (releaseProps.containsKey("JAVA_PROFILE")) { //$NON-NLS-1$
+ embeddedProfileName = "_" + releaseProps.getProperty("JAVA_PROFILE") + "-"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ } catch (IOException e) {
+ // ignore
+ }
+ }
+ }
+ }
+ vmProfile = javaEdition + embeddedProfileName + javaSpecVersion;
}
}
}
@@ -1401,7 +1421,7 @@ public class Storage {
String javaProfile = vmProfile + PROFILE_EXT;
profileIn = findInSystemBundle(systemGeneration, javaProfile);
if (profileIn == null)
- profileIn = getNextBestProfile(systemGeneration, javaEdition, javaVersion);
+ profileIn = getNextBestProfile(systemGeneration, javaEdition, javaVersion, embeddedProfileName);
}
if (profileIn == null)
// the profile url is still null then use the osgi min profile in OSGi by default
@@ -1429,21 +1449,25 @@ public class Storage {
return result;
}
- private InputStream getNextBestProfile(Generation systemGeneration, String javaEdition, Version javaVersion) {
+ private InputStream getNextBestProfile(Generation systemGeneration, String javaEdition, Version javaVersion, String embeddedProfileName) {
if (javaVersion == null || (javaEdition != J2SE && javaEdition != JAVASE))
return null; // we cannot automatically choose the next best profile unless this is a J2SE or JavaSE vm
- InputStream bestProfile = findNextBestProfile(systemGeneration, javaEdition, javaVersion);
+ InputStream bestProfile = findNextBestProfile(systemGeneration, javaEdition, javaVersion, embeddedProfileName);
if (bestProfile == null && javaEdition == JAVASE)
// if this is a JavaSE VM then search for a lower J2SE profile
- bestProfile = findNextBestProfile(systemGeneration, J2SE, javaVersion);
+ bestProfile = findNextBestProfile(systemGeneration, J2SE, javaVersion, embeddedProfileName);
+ if (bestProfile == null && !"-".equals(embeddedProfileName)) { //$NON-NLS-1$
+ // Just use the base javaEdition name without the profile name as backup
+ return getNextBestProfile(systemGeneration, javaEdition, javaVersion, "-"); //$NON-NLS-1$
+ }
return bestProfile;
}
- private InputStream findNextBestProfile(Generation systemGeneration, String javaEdition, Version javaVersion) {
+ private InputStream findNextBestProfile(Generation systemGeneration, String javaEdition, Version javaVersion, String embeddedProfileName) {
InputStream result = null;
int minor = javaVersion.getMinor();
do {
- result = findInSystemBundle(systemGeneration, javaEdition + javaVersion.getMajor() + "." + minor + PROFILE_EXT); //$NON-NLS-1$
+ result = findInSystemBundle(systemGeneration, javaEdition + embeddedProfileName + javaVersion.getMajor() + "." + minor + PROFILE_EXT); //$NON-NLS-1$
minor = minor - 1;
} while (result == null && minor > 0);
return result;
diff --git a/bundles/org.eclipse.osgi/profile.list b/bundles/org.eclipse.osgi/profile.list
index 9f71a8d37..474bd64a8 100644
--- a/bundles/org.eclipse.osgi/profile.list
+++ b/bundles/org.eclipse.osgi/profile.list
@@ -17,6 +17,9 @@ java.profiles = \
J2SE-1.3.profile,\
J2SE-1.2.profile,\
JRE-1.1.profile,\
+ JavaSE_compact1-1.8.profile,\
+ JavaSE_compact2-1.8.profile,\
+ JavaSE_compact3-1.8.profile,\
CDC-1.1_Foundation-1.1.profile,\
CDC-1.0_Foundation-1.0.profile,\
OSGi_Minimum-1.0.profile,\

Back to the top