The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

jesperdj (1) [Avatar] Offline
I am using Ubuntu 11.10 (64-bit) with Oracle JDK 1.7.0 update 3.

When I try to run the example from chapter 3, I get an error about a missing dependency that has to do with Swing:

-> install file:../paint-example/bundles/paint-3.0.jar
Bundle: 2
-> install file:../paint-example/bundles/shape-3.0.jar
Bundle: 3
-> start 2
org.osgi.framework.BundleException: Unresolved constraint in bundle [2]: Unable to resolve 2.0: missing requirement [2.0] package; (package=javax.swing)
at org.apache.felix.framework.Felix.resolveBundle(
at org.apache.felix.framework.Felix.startBundle(
at org.apache.felix.framework.BundleImpl.start(
at org.apache.felix.framework.BundleImpl.start(
Unable to execute: start 2

When I try it with Oracle JDK 1.6.0 update 31 it works normally.

Is this a known problem? Can this be easily fixed to work with Java 7?
franferri (1) [Avatar] Offline
Re: Chapter 3 example does not work with Java 7
Same to me, Windows 7

java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) Client VM (build 23.7-b01, mixed mode, sharing)

Any idea what happens?
stuart.mcculloch (29) [Avatar] Offline
Re: Chapter 3 example does not work with Java 7
The Felix launcher bundled with the original examples did not contain a profile for Java7. The latest code adds a Java7 profile via customized launcher properties:

Alternatively you could also update the Felix launcher jar, but this is a simpler fix.