Giter Club home page Giter Club logo

spring-javafx's Introduction

将基于springboot的javafx项目打包为exe

基于spring-boot 3.2.1 jdk17 依赖fx使用17,如org.openjfx:javafx-controls:17.0.2 项目依赖的javafx,本地安装的是F:\tools\javafx-sdk-21.0.1\lib,idea中dependencies添加jar包库

  1. 先打包成可执行的jar

使用springboot自身的插件打包

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includeSystemScope>true</includeSystemScope>
                    <mainClass>com.feng.spring.javafx.SpringJavafxApplication</mainClass>
                    <excludeDevtools>false</excludeDevtools>
                </configuration>
            </plugin>
        </plugins>
    </build>

执行打包

mvn clean package
  1. 利用jpackage打包
#打包绿色版本可执行文件
jpackage --type app-image --name javafx --input target --main-jar javafx-0.0.1.jar --win-console --dest dist

#打包用于安装的exe文件
jpackage --type exe --name javafx --input target --main-jar javafx-0.0.1.jar

#打包用于安装的msi文件
jpackage --type msi --name javafx --input target --main-jar javafx-0.0.1.jar

spring-javafx's People

Contributors

lanhaifeng 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.