GithubHelp home page GithubHelp logo

graalvm-demo's Introduction

java程序graalvm打包编译成exe

下载安装JDK17

https://download.oracle.com/java/17/latest/jdk-17_windows-x64_bin.exe

下载安装graalvm

教程https://www.graalvm.org/latest/docs/getting-started/#install-graalvm

安装Native Image

gu install native-image

编写程序

 public class HelloWorld {
     public static void main(String[] args) {
         System.out.println("Hello, Native World!");
     }
 }

打包程序可执行jar(使用java -jar xxx.jar可执行)

编译jar成exe文件

native-image -jar xxx.jar

注意事项

配置环境变量,各系统可能不一样,可根据错误提示的,配置具体位置

JAVA_HOME  C:\Users\chenyun\tools\graalvm-ce-java17-22.3.1

INCLUDE D:\Windows Kits\10\Include\10.0.19041.0\ucrt;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\include;D:\Windows Kits\10\Include\10.0.19041.0\um;D:\Windows Kits\10\Include\10.0.19041.0\shared;

LIB  D:\Windows Kits\10\Lib\10.0.19041.0\um\x64;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\lib\x64;D:\Windows Kits\10\Lib\10.0.19041.0\ucrt\x64;



path  C:\Users\chenyun\tools\graalvm-ce-java17-22.3.1\bin;C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx86\x64

graalvm-demo's People

Contributors

cheny-stack 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.