qfel13

This user hasn't shared any biographical information

Homepage: http://qfel13.wordpress.com

How to create exe for java program

I always had the same problem with java programs packed with jar. How to run them in friendly manner. The best example of this can be eclipse which is run from eclipse.exe but it is written entirely in java.

I search a lot for some program which would make this easy and I found it. It’s called JSmooth.

So I had my application called Ndsr in jar file ndsr.jar

First we need to run JSmooth.

Then go to tab Skeleton and choose Windowed wrapper

Put message which will be shown to user when appropriate JVM is not found on user’s machine.

Also check “Launch java app in the exe process.

Save configuration in folder where you have your application jar

Next go to application tab and click icon with ‘+’ to add this jar.

Then click on ‘…’ button next to Main class text field to choose main class (this should be done automatically if you have main class defined in manifest but isn’t)

Choose your main class from ‘Available Classes’ and click select

Go to Executable tab and put name of your application with exe extension

You can also choose icon but there are some problems with .ico files (another bug) and png files are very ugly resized.

I next post I will describe how to change/add icon in exe files.

Then we need to specify JVM version so we need to go to JVM Section tab

Put version in Minimum JVM Version field.

If you need any specific JVM arguments go to JVM Configuration tab

So we are ready to go. Just click icon with gear or go to Project > Compile in menu.

, , , ,

1 Comment

Chrome application redirection loop problem

Recently I tried to pack my game http://qfel13.github.com/xit/ into chrome app. To enable offline playing in my game. When I did this there was problem with redirection to level editor.

Chrome communicated that there is redirection loop.

I checked my code of redirection and there was something like this:

window.href = '/editor/#load';

The problem was that href didn’t point to actual page so ‘/editor/index.html’ but only to folder for which webserver automatically served index.html file.

The same problem was with redirection from editor to game

window.href = '../#load';

Needed to be changed to:

window.href = '../index.html#load';

Everything started to work well after this changes. You can find game app here.

, , ,

Leave a comment