Take the 2-minute tour ×

I'm using SpartacusRex's Terminal IDE and another app, DroidEdit, to build and run java applications on Android. A simle one-file Hello World builds and runs flawlessly, however when i introduce packages i cannot properly dex the class files into a jar file:

From my project directory:
javac src/mypack/*.java
This Compiles Successully
dx --dex --output=Test.jar src
This gives my the following warning

trouble processing:
class name (mypack/Main) does not match path (Main.class)
... while parsing Main.class
... while processing Main.class

All paths and package names are correct. Main.java is in a folder called "mypack" and has a packgage statement "package mypack;".
What am I doing wrong ? Also, using --no-strict removes the warning but the outputted jar file is not built correctly and cannot be run.

Any help is appreciated. Thanks :)

share|improve this question
add comment

2 Answers

You must put the class files inside a directory named exactly like it's package name and then create the jar file from it.

for example com.test.me.MyActivity must be at com/test/me/MyActivity.class

share|improve this answer
add comment

According to your question all *.class files are in mypack/ directory so issue following command it might help you .

dx --dex --output=classes.dex src/mypack/

dx will pick all the files from mypack directly . consider reading this SO question

share|improve this answer
add comment

Your Answer


