How to make JavaME .jar files downloadable from Apache Web Server
|
|
Mobile application developers may have realize that one of the best (and recommended) way to distribute their JavaME/J2ME application is by hosting it on a website. This makes it easier for potential users to navigate and download the .jad or .jar files from their phone browsers and to execute it directly.
However, some web servers are not configured to handle .jar / .jad file requests, eventually leading to failed install response received by the mobile users.
To remedy this, .jad / .jar files need to be associated with the correct MIME type. In Apache, you can do this by creating ‘.htaccess’ file in your web directory, and inserting these lines :
# JavaME
AddType text/vnd.sun.j2me.app-descriptor .jad
AddType application/java-archive .jar
Afterwards, safe the file. The web server should behave accordingly when requests are made to either of these files. For other web servers, please refer to their respective manual or online-help on how to change document MIME type.
Tags: apache, apache2, htaccess, j2me, jar, java, javame, Server
Keep updated with the latest posts, be a part of over 1,000 subscribers! :
Subscribe to your email
You might also want to read...
- jar2jad – My first python application
- How to set the correct Android *.apk MIME Type for Apache Webserver
- Optimise your openoffice files with KJar
- Adapting StringTokenizer for J2ME
- j2meshitheap.com – a list of the world’s worst J2ME-enabled phones
- Apache mod_rewrite cheat sheet
- Using Apache mod_security and .htaccess to block comment spam on the web


June 14th, 2011 at 3:02 pm
Thank you for the article and I just want to know one thing.
How to make jar files downloadable by mobile devices from Apache webserver.