DEV Community

Discussion on: How can I make my Jar file executable on all computers?

Collapse
 
jmfayard profile image
Jean-Michel πŸ•΅πŸ»β€β™‚οΈ Fayard

That's not so simple actually
Big applications like Android Studio or IntelliJ just includes their own copy of the JRE inside the app.

I googled a bit for you and found this docs.oracle.com/javafx/2/deploymen...

and also this

GitHub logo fvarrui / JavaPackager

πŸ“¦ Gradle/Maven plugin to package Java applications as native Windows, Mac OS X, or GNU/Linux executables and create installers for them.

JavaPackager

Maven Central

JavaPackager is a hybrid plugin for Maven and Gradle which provides an easy way to package Java applications in native Windows, Mac OS X or GNU/Linux executables, and generate installers for them.

SNAPSHOT version is not released to Maven Central, so you have to install it manually.

πŸ‘€ See JavaPackager changes and fixes.

History

It was born while teaching to my students how to build and distribute their Java apps, and after seeing that a chain of several plugins was needed to achieve this task, I decided to develop a plugin πŸ’ to govern them all.

How to use this plugin

Package your app with Maven

Add the following plugin tag to your pom.xml:

<plugin&gt
    <groupId>io.github.fvarrui</groupId&gt
    <artifactId>javapackager</artifactId&gt
    <version>1.4.2</version&gt
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
…
Enter fullscreen mode Exit fullscreen mode
Collapse
 
baenencalin profile image
Calin Baenen

I know how to do the second to last one, but how do I do the second one?
Section 5.5 of the linked Oracle documentation.