Search code examples
javadeploymentsicstus-prolog

problems to deploy a java application


I just finished a Java application to link to Sicstus prolog. Now I need to deploy it but I'm having the following problem, the Sicstus library to link with Java requires that the application be called with the following sintax:

java -classpath=path/to/sicstus/installation/dir -jar /path/to/jarfile.jar    

I'm deploying a .sh or .bat file but the user has to edit it manually and state where the sicstus installation directory is. How can I avoid that?

I'm really stuck here. I've tried a couple of installers builders like JSmooth and GlassWorks but those doesn't fix my problem. Any idea?

Joshua.


Solution

  • Use IzPack in order to create installers. With this you gain the ability to install an application in the desired directory.

    http://izpack.org

    Furthermore you can also parse the bat file to point the installation directory by doing the following:

    Create a bat file like this run.bat:

    java -classpath=$INSTALL_PATH/lib/alib.jar  -jar $INSTALL_PATH/bin/myapp.jar
    

    And specify the following in the install.xml:

    <pack name="Base" required="yes">
            <file src="run.bat" targetdir="$INSTALL_PATH" override="true" />
                    <parsable targetfile="$INSTALL_PATH/run.bat"/>
    </pack>
    

    This will parse the bat and replace it with the installation directory.