i want to know how to make a jar app which will run on java mobile platform using class file of java. i know basics of java like inheritance,interface,string.....I tried this thing by compiling my java program of simple input/output and then converting it to jar using -jar in cmd.but i dont know why it is not working on mobile showing invalid file. plz help me.
Asked
Active
Viewed 1,154 times
1 Answers
0
If you want to create a jar application, starting from a java class,you don't have to use java -jar filename.jar
, this is only for execution.
Try this: jar cf your_jar_app.jar your_class_file.class
c
option is needed to create file and f
option is needed because you want an output file.
Then you can execute typing: java -jar your_jar_app.jar
Hope this can help you.
For documentation: Oracle Documentation for creating JAR file If you are using NetBeans IDE, take a look to: NetBeans Packaging and Deploying Java Applications

Alberto Solano
- 7,972
- 3
- 38
- 61