Is there a mechanism to distribute an app with its own JRE?

前端 未结 4 1009
攒了一身酷
攒了一身酷 2020-12-16 03:33

These fine folks are my users: http://www.youtube.com/watch?v=o4MwTvtyrUQ

If you don\'t want to enjoy the video here is the gist: my users can\'t tell between a file

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-16 04:13

    Or in short, you can try this:

    Make a self executable jar file of your app.

    • Provide your users small JRE setup (appx 15MB for jre6u7) along with your app.
    • Now create a batch file(for windows) which will first execute the JRE installer.
    • Then select path to installed JRE's 'bin' folder.
    • Now after this write 'java -jar yourAppName.jar' in the script to run your executable jar file.

    eg: for win.bat write the following:

    jre-6u7-windows-i586-p  :: this will start the JRE installer
    C:\Program Files\Java\jre1.6.0_07\bin\java -jar yourAppName.jar  :: this will start your app
    

    You can create such scripts for Mac and Linux also.

提交回复
热议问题