Search code examples
javawindowsjvmdukescript

packaging dukescript as native windows app


Recently I read on Dukescript page

DukeScript’s is pure client technology: You write your application and it’s business logic in Java which is compiled to Java bytecode. The bytecode is running in a normal JVM. If you deploy the application to the Desktop, the JVM is HotSpot, and you deploy an executable, e.g. an exe on Windows.

How can I package a native desktop app using Dukescript for Windows platform since no native package option is enabled at the project properties?


Solution

  • Solved! I created an article about it, the essential steps are as follows:

    1. Created a new dukescript application with the following specifications:
    • used the sample hello world project with knockout
    • named it nativeds
    • no plataforms selected so only javafx version will be avalible
    1. Addeded a plugin generated at http://javafx-maven-plugin.github.io/

    maven plugin tag:

    <plugin>
        <groupId>com.zenjava</groupId>
        <artifactId>javafx-maven-plugin</artifactId>
        <version>8.1.4</version>
        <configuration>
            <mainClass>org.javapro.nativeds.Main</mainClass>
            <verbose>true</verbose>
            <vendor>javapro.org</vendor>
            <nativeReleaseVersion>0.1</nativeReleaseVersion>
            <additionalAppResources>${project.basedir}/src/main/webapp</additionalAppResources>
        </configuration>
        <executions>
            <execution>
                <!-- required before build-native -->
                <id>create-jfxjar</id>
                <phase>package</phase>
                <goals>
                    <goal>build-jar</goal>
                </goals>
            </execution>
            <execution>
                <id>create-native</id>
                <phase>package</phase>
                <goals>
                    <goal>build-native</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    

    Thanks for your help.