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

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.

9 Responses to “Error: [javac] Activator.java:3: package org.osgi.framework does not exist [javac] import org.osgi.framework.BundleActivator;”

  1. Titiritero says:

    Que buena la bola del Mundo. El de Novelda soy yo. No se porque pero yo estoy en todos sitios menos donde debo de estar. Un dia de estos te aparecerá que vienen mis visitas desde china.

    ¿Qué es knopflerfish?

  2. Alfredo says:

    Knopflerfish es una version del framework OSGi que utilizo para el proyecto en el que estoy trabajando.

    En cuanto a lo de Novelda, denuncia a la empresa por boicotear el principado de Balsicas.

  3. Titiritero says:

    ¿Qué es un framework?

  4. Alfredo says:

    ¿Que es splunge?

  5. Titiritero says:

    ¿Donde está Noruega e Italia?

    España está en semifinales.

  6. Alfredo says:

    Estan haciendo cosas mas importantes que ver el futbol.

  7. Marcelo says:

    Muchísimas gracias! Estoy empezando a meterme con OSGi y tenía exactamente el mismo problema.

    Gracias!

  8. Alfredo says:

    Me alegro mucho de que te sirviera de utilidad.

  9. Java es un lenguaje no Titiritero. Los titiriteros odiamos ese lenguaje de programación.
    ¡Utilicen C o C++!¡COÑOOOOOO!¡Que para eso está!

Leave a Reply


+ 1 = 5