Original link: http://blog.sina.com.cn/s/blog_658c8cea0101mdhp.html
The steps are as follows:
1. Package The files into executable jar files (which can be export in eclipse), such as Test.jar;2. Then use DX to compile the class into Dex files, Dex for Android to use the Dalvik virtual machine to recognize the compiled files:go to the android_sdk\build-tools\android-4.3\ directory and execute the following command: (to place the packaged jar file in this directory, specify the directory if not put)DX--dex--output=classes.dex test.jar3. Packaging the generated classes.dex into the Test.jar, you can directly open the jar file with the compression software, the Classes.dex file can be dragged in;4. Import the jar package into your Android device:adb push test.jar/data/local/tmp//Push the PC-side compiled jar package to the/data/local/tmp directory in the Android device5. Set Classpath:Export Classpath=/data/local/tmp/test.jar6. Start the jar:app_process/data/local/tmp svpn.udp.test.TestThere is a main method in//svpn.udp.test.test to this jar file is executed. Jar Package Directory structure: (Classes.dex and Meta-inf folders at one directory level)
Test.java File:
execution process and output:
Run the jar file on Android system