Apache Felix Framework and Google Android, exception when using dx command: java.io.FileNotFoundException

StackOverflow https://stackoverflow.com/questions/18525687

  •  26-06-2022
  •  | 
  •  

Question

I just started trying to use Felix with Android. I followed the instruction at Apache Felix homepage (http://felix.apache.org/site/apache-felix-framework-and-google-android.html), but failed at very first steps.

After setting path for Android SDK, I executed this command:

dx --dex --output=classes.dex felix.jar

But the exception came out:

UNEXPECTED TOP-LEVEL EXCEPTION:
java.io.FileNotFoundException: felix.jar (The system cannot find the file specif
ied)
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:214)
    at java.util.zip.ZipFile.<init>(ZipFile.java:144)
    at java.util.zip.ZipFile.<init>(ZipFile.java:158)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:206)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
    at com.android.dx.command.dexer.Main.processOne(Main.java:422)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333)
    at com.android.dx.command.dexer.Main.run(Main.java:209)
    at com.android.dx.command.dexer.Main.main(Main.java:174)
    at com.android.dx.command.Main.main(Main.java:91)
1 error; aborting

I am sure that the file felix.jar was there. This is what I got from dir command:

Directory of D:\QuangND\OSGi\felix-framework-4.2.1\bin

08/30/2013  11:11 AM    <DIR>          .
08/30/2013  11:11 AM    <DIR>          ..
03/08/2013  10:19 PM           529,233 felix.jar
           1 File(s)        529,233 bytes
           2 Dir(s)  198,324,461,568 bytes free`

What is problem here? Thank you very much! (Sorry for my bad English :()

Was it helpful?

Solution

OK, I solved this problem. I need to start dx command from where it located (in sdk/platform-tools), not everywhere

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top