minte9
LearnRemember



JAR

Add archive plugin dependency to your Maven project (pom.xml).
 
<plugin>
  <!-- Build an executable JAR -->
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-jar-plugin</artifactId>
  <version>3.2.0</version>
  <configuration>
    <archive>
      <manifest>
        <addClasspath>true</addClasspath>
        <classpathPrefix>/usr/share/openjfx/lib/</classpathPrefix>
        <mainClass>com.example.App</mainClass>
      </manifest>
    </archive>
  </configuration>
</plugin>

Build

Use package command to build the project.
 
mvn package
You may test the newly compiled and packaged JAR with the following command:
 
java --module-path /usr/share/openjfx/lib/ \
     --add-modules javafx.controls,javafx.fxml \
      -jar ./target/java-pages-1.0.jar

Netbeans

Download JavaFx SDK from gluonhq.com Netbeans > Tools, Library, New Library: JavaFX17 Create Java Project (Ant -> Java Application). Don't use JavaFx Project (not ready yet). Properties / Libraries / Compile / Add Library to ClassPath Netbeans / build.xml / Package for store.
 
cd ~NetBeansProjects/HelloFx

java -jar store/hellofx.jar 



  Last update: 303 days ago