Archive for June 20th, 2008

Error: [javac] Activator.java:3: package org.osgi.framework does not exist [javac] import org.osgi.framework.BundleActivator;

Friday, June 20th, 2008

I have been fighting OSGi for a while by following a tutorial from Sven Haiges (Vodafone). The question is that I got an error with the following message when I tryied to run build.xml:
[javac] …\Activator.java:3: package org.osgi.framework does not exist
[javac] import org.osgi.framework.BundleActivator;
…….  (muchos más)

I had already added the classpath in eclipse so I didn’t know why it was failing. It seems that ant is not using the classpath from eclipse so I solved the problem modifying the build.xml propposed in the tutorial in this way.

<javac destdir = “./classes”
debug = “on”
srcdir = “./src”
classpath = “C:\knopflerfish_osgi_2.1.0\knopflerfish.org\osgi\framework.jar”
>

I added the value for the classpath (supposing that this is the instalation directory for knopflerfish) to the javac tag.

By doing this the compilation will work fine.