Git Product home page Git Product logo

graalvmdemo's Introduction

GraalvmDemo

GraalvmDemo

javafx application on Windows using graalvm

mvn clean gluonfx:build gluonfx:package

step1 setup graalvm

https://github.com/graalvm/graalvm-ce-builds/releases

for Windows and java17, download this one:

graalvm-ce-java17-windows-amd64-22.0.0.2.zip https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/graalvm-ce-java17-windows-amd64-22.0.0.2.zip

unzip it to some path on your disk, like D:/java/graalvm/graalvm-ce-java17-22.0.0.2/

add system environments variable, for example:

GRAALVM_HOME D:/java/graalvm/graalvm-ce-java17-22.0.0.2/

JAVA_HOME %GRAALVM_HOME%

add this into system path: path: oldPath;%JAVA_HOME%\bin

in cmd tool, input this command:

java -version

if output like this,it means graalvm install succeed:

openjdk version "17.0.2" 2022-01-18
OpenJDK Runtime Environment GraalVM CE 22.0.0.2 (build 17.0.2+8-jvmci-22.0-b05)
OpenJDK 64-Bit Server VM GraalVM CE 22.0.0.2 (build 17.0.2+8-jvmci-22.0-b05, mixed mode, sharing)

download native-image tool: native-image-installable-svm-java17-windows-amd64-22.0.0.2.jar https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-22.0.0.2/native-image-installable-svm-java17-windows-amd64-22.0.0.2.jar

install native-image tool:

gu -L install path-to-native-image-jar-file

for example, if you save the native-image jar file in D:/download, the command will be:

gu -L install D:/download/native-image-installable-svm-java17-windows-amd64-22.0.0.2.jar

tips: gu is graalvm-ce-java17-22.0.0.2\bin\gu.cmd

step2 setup visual studio

make sure visual studio installed, if not, here you can download it https://visualstudio.microsoft.com/zh-hans/downloads/

install MSVS, include C++ desktop module.

add system environments variable:

WINDOWS_KITS C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64

WK10_INCLUDE C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0

WK10_LIB C:\Program Files (x86)\Windows Kits\10\Lib\10.0.19041.0

10.0.19041.0 is the tool kits version on my System, It maybe different on your System.

input this command in cmd:

cl -version

if you see cl version info, it means visual studio install and setup succeed.

step3 build

download my project, and open it in IDEA (https://www.jetbrains.com/idea/)

setup maven and project jdk, then run in terminal:

mvn clean gluonfx:build

exe file is in GraalvmDemo\target\gluonfx

tips:

gluonfx:build = gluonfx:compile + gluonfx:link

step4 package

download wix: https://wixtoolset.org/releases/ install wix, than restart idea, open this project, if exe file already exits, run:

mvn gluonfx:package

else run:

mvn clean gluonfx:build gluonfx:package 

if success, exe and msi file is in GraalvmDemo\target\gluonfx

tips:

  1. custom exe icon: if you want set an icon (.ico file) as icon of exe file, copy your ico file into /src/windows/asset/icon.ico, overwrite exists one.

  2. version and vendor in pom.xml,

<!--...-->
<build>
    <plugins>
        <!--...-->
        <plugin>
            <!--...-->
            <configuration>
                <!--...-->
                <releaseConfiguration>
                    <!--...-->
                    <vendor>VendorName</vendor>
                    <version>1.0.0</version>
                </releaseConfiguration>

            </configuration>
        </plugin>

    </plugins>
</build>
<!--...-->

VendorName can be any string as you wish, but take care of version, it must be different every time you make package (msi file), if you install an old version one, and then try to install a new one with the same version, it will be failure. And the version must increase every time, if new package(msi)'s version less than old one, it also can not install.

graalvmdemo's People

Contributors

xingray avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.