Comments (10)
Thanks for reporting this.
In Java 9 the "java.specification.version" property has been changed so that the former major version "1" as in "1.9" has been dropped and former minor version has become major version, e.g. "9"
Knopflerfish makes checks to verify the major version is "1"
You can go around the problem for now by setting:
Forg.osgi.framework.executionenvironment="JavaSE-9"
from knopflerfish.org.
Unfortunately I can not use this workaround because the Version constructor throws an exception given string "9.-1" which is currently returned as java version property value.
from knopflerfish.org.
Which OS and version of Java9 are you using?
from knopflerfish.org.
Windows 10
C:\Program Files\Java\jdk-9\bin>java -version
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+143)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+143, mixed mode)
from knopflerfish.org.
Strange, I don't understand where the "9.-1" string comes from.
What happens if you start like this:
java -jar framework.jar -Forg.osgi.framework.executionenvironment="JavaSE-9" -init
from knopflerfish.org.
I have investigated what happens. It turned out that problems are in class FWProps.
System.getProperty("java.specification.version") returns "9" .
System.getProperty("java.version") would return "9-ea", but it is not relevant.
Therefore blocks
if (startPos < endPos) {
javaVersionMinor = Integer.parseInt(javaVersion.substring(startPos, endPos));
startPos = endPos + 1;
endPos = startPos;
while (endPos < max && Character.isDigit(javaVersion.charAt(endPos))) {
endPos++;
}
if (startPos < endPos) {
javaVersionMicro = Integer.parseInt(javaVersion.substring(startPos, endPos));
}
}
are ignored,
javaVersionMajor is set to 9, javaVersionMinor and javaVersionMicro remain equal to -1.
and code
setPropertyDefault(SYSTEM_PACKAGES_VERSION_PROP, Integer.toString(javaVersionMajor) + "."
+ javaVersionMinor);
sets this property to "9.-1" . It causes the exception in constructor of Version which I mentioned before.
Also in block
if (!props.containsKey(FRAMEWORK_EXECUTIONENVIRONMENT)) {
final StringBuffer ee = new StringBuffer();
// Always allow ee minimum
ee.append("OSGi/Minimum-1.0");
ee.append(",OSGi/Minimum-1.1");
ee.append(",OSGi/Minimum-1.2");
// Set up the default ExecutionEnvironment
if (1 == javaVersionMajor) {
for (int i = javaVersionMinor; i > 1; i--) {
ee.append((i > 5) ? ",JavaSE-1." : ",J2SE-1.");
ee.append(i);
}
}
props.put(FRAMEWORK_EXECUTIONENVIRONMENT, ee.toString());
}
for-loop is not executed and in method SystemBundle.initSystemBundle() provideCapabilityString becomes 'osgi.ee;osgi.ee=OSGi/Minimum;version:List="1.0.0,1.1.0,1.2.0"'
As a workaround I can set properties
-Forg.knopflerfish.framework.system.packages.version=1.7.0
-Forg.osgi.framework.system.capabilities=osgi.ee;osgi.ee=JavaSE;version:List<Version>="1.2.0,1.3.0,1.4.0,1.5.0,1.6.0,1.7.0",osgi.ee;osgi.ee=OSGi/Minimum;version:List<Version>="1.0.0,1.1.0,1.2.0"
because I actually need JavaSE 7 only .
Well, after I force these property values it turns out that Java9 is still full of bugs, but is another issue.
from knopflerfish.org.
Fixed in framework 8.0.2. Available in https://bintray.com/knopflerfish/master/download_file?file_path=distrib_6.0.0.snapshot-1701031635-master%2Fknopflerfish_osgi_sdk_6.0.0.snapshot-1701031635-master.jar
from knopflerfish.org.
How can the fixed version be used as maven / gradle dependency?
from knopflerfish.org.
Sorry for the late reply.
The fix is in the KF 6.1 release and the framework and bundles are included in the KF 6.1 maven release repository.
All the maven artifacts are listed here
http://www.knopflerfish.org/releases/6.1.0/maven2/org/knopflerfish/kf6/KF-6.1.0_dependencyManagement.xml
The maven2 repo is browsable at:
http://www.knopflerfish.org/releases/6.1.0/maven2/org/knopflerfish/kf6/
The KF 6.1 bundles can
from knopflerfish.org.
Thank you.
We still have time before java 9 release.
And with this version it works fine.
from knopflerfish.org.
Related Issues (20)
- proguard does not support java 9
- asm and JDK9 HOT 1
- Release docs: index.html
- Release docs: index.html
- docs: programming.html
- Dynamic import dead lock HOT 1
- Building with JDK10 fails HOT 1
- Improve framework log message when unable to resolve
- Using target property filters may cause SCR to give incorrect errors for circular component chains
- Junit test doesn't detect if it fails to start a test bundle HOT 2
- SCR doesn't handle service that dynamically changes service ranking
- reference:file: bundles can not be loaded if org.knopflerfish.osgi.registerserviceurlhandler=false HOT 2
- Compiling KF with JDK 11 HOT 4
- Deadlock weaving hooks HOT 1
- Question about Knopflerfish R7 compatibility for SCR HOT 2
- SCR gets ConcurrentModificationException in service listener HOT 1
- API question: HttpService registerServlet and registerResources enumeration HOT 1
- Is this project dead? HOT 1
- Http Server: threads created in transactions increase activeCount and server will eventually stop processing requests
- Generate a maven repository index file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knopflerfish.org.