Creating a Linux executable file for my Java application Jar file
I found that Packr is the best tool to use for creating an executable file for my Java application on Linux. The executable works perfectly on Linux, but i have a question about this tool:
The tool forces me to embed JRE with the output folder causing big output size for my application. Can i create the executable without embedding JRE with it?
java executable packr
add a comment |
I found that Packr is the best tool to use for creating an executable file for my Java application on Linux. The executable works perfectly on Linux, but i have a question about this tool:
The tool forces me to embed JRE with the output folder causing big output size for my application. Can i create the executable without embedding JRE with it?
java executable packr
1
Java applications can't run without a JRE...unless you want to distribute a JAR and require that everyone that installs your application have the JRE installed, bundling the JRE in your executable is the only other real option.
– Makoto
Jan 1 at 7:12
1
There has to be a JRE involved somewhere, and if you're not bundling the JRE then there's no point in not just distributing a jar.
– chrylis
Jan 1 at 7:25
I am aware of course that JRE is needed to run Java applications, but none of my users had problems downloading and installing JRE manually, so i see no need to bundle a JRE with my application. I just want to have an executable with my application to be user friendly for Linux users, just like an *.exe file in Windows operating system.
– Brad
Jan 3 at 7:49
add a comment |
I found that Packr is the best tool to use for creating an executable file for my Java application on Linux. The executable works perfectly on Linux, but i have a question about this tool:
The tool forces me to embed JRE with the output folder causing big output size for my application. Can i create the executable without embedding JRE with it?
java executable packr
I found that Packr is the best tool to use for creating an executable file for my Java application on Linux. The executable works perfectly on Linux, but i have a question about this tool:
The tool forces me to embed JRE with the output folder causing big output size for my application. Can i create the executable without embedding JRE with it?
java executable packr
java executable packr
asked Jan 1 at 7:11
BradBrad
2,12294777
2,12294777
1
Java applications can't run without a JRE...unless you want to distribute a JAR and require that everyone that installs your application have the JRE installed, bundling the JRE in your executable is the only other real option.
– Makoto
Jan 1 at 7:12
1
There has to be a JRE involved somewhere, and if you're not bundling the JRE then there's no point in not just distributing a jar.
– chrylis
Jan 1 at 7:25
I am aware of course that JRE is needed to run Java applications, but none of my users had problems downloading and installing JRE manually, so i see no need to bundle a JRE with my application. I just want to have an executable with my application to be user friendly for Linux users, just like an *.exe file in Windows operating system.
– Brad
Jan 3 at 7:49
add a comment |
1
Java applications can't run without a JRE...unless you want to distribute a JAR and require that everyone that installs your application have the JRE installed, bundling the JRE in your executable is the only other real option.
– Makoto
Jan 1 at 7:12
1
There has to be a JRE involved somewhere, and if you're not bundling the JRE then there's no point in not just distributing a jar.
– chrylis
Jan 1 at 7:25
I am aware of course that JRE is needed to run Java applications, but none of my users had problems downloading and installing JRE manually, so i see no need to bundle a JRE with my application. I just want to have an executable with my application to be user friendly for Linux users, just like an *.exe file in Windows operating system.
– Brad
Jan 3 at 7:49
1
1
Java applications can't run without a JRE...unless you want to distribute a JAR and require that everyone that installs your application have the JRE installed, bundling the JRE in your executable is the only other real option.
– Makoto
Jan 1 at 7:12
Java applications can't run without a JRE...unless you want to distribute a JAR and require that everyone that installs your application have the JRE installed, bundling the JRE in your executable is the only other real option.
– Makoto
Jan 1 at 7:12
1
1
There has to be a JRE involved somewhere, and if you're not bundling the JRE then there's no point in not just distributing a jar.
– chrylis
Jan 1 at 7:25
There has to be a JRE involved somewhere, and if you're not bundling the JRE then there's no point in not just distributing a jar.
– chrylis
Jan 1 at 7:25
I am aware of course that JRE is needed to run Java applications, but none of my users had problems downloading and installing JRE manually, so i see no need to bundle a JRE with my application. I just want to have an executable with my application to be user friendly for Linux users, just like an *.exe file in Windows operating system.
– Brad
Jan 3 at 7:49
I am aware of course that JRE is needed to run Java applications, but none of my users had problems downloading and installing JRE manually, so i see no need to bundle a JRE with my application. I just want to have an executable with my application to be user friendly for Linux users, just like an *.exe file in Windows operating system.
– Brad
Jan 3 at 7:49
add a comment |
1 Answer
1
active
oldest
votes
If you are using java 9 or above you can use jlink to create an image that only contains the required jre modules and therefore will likely give you a smaller distributable. There's a tutorial here
Nice suggestion, but i am still using Java 8.
– Brad
Jan 3 at 7:50
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53993689%2fcreating-a-linux-executable-file-for-my-java-application-jar-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you are using java 9 or above you can use jlink to create an image that only contains the required jre modules and therefore will likely give you a smaller distributable. There's a tutorial here
Nice suggestion, but i am still using Java 8.
– Brad
Jan 3 at 7:50
add a comment |
If you are using java 9 or above you can use jlink to create an image that only contains the required jre modules and therefore will likely give you a smaller distributable. There's a tutorial here
Nice suggestion, but i am still using Java 8.
– Brad
Jan 3 at 7:50
add a comment |
If you are using java 9 or above you can use jlink to create an image that only contains the required jre modules and therefore will likely give you a smaller distributable. There's a tutorial here
If you are using java 9 or above you can use jlink to create an image that only contains the required jre modules and therefore will likely give you a smaller distributable. There's a tutorial here
answered Jan 1 at 7:33
stegzzzstegzzz
926
926
Nice suggestion, but i am still using Java 8.
– Brad
Jan 3 at 7:50
add a comment |
Nice suggestion, but i am still using Java 8.
– Brad
Jan 3 at 7:50
Nice suggestion, but i am still using Java 8.
– Brad
Jan 3 at 7:50
Nice suggestion, but i am still using Java 8.
– Brad
Jan 3 at 7:50
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53993689%2fcreating-a-linux-executable-file-for-my-java-application-jar-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Java applications can't run without a JRE...unless you want to distribute a JAR and require that everyone that installs your application have the JRE installed, bundling the JRE in your executable is the only other real option.
– Makoto
Jan 1 at 7:12
1
There has to be a JRE involved somewhere, and if you're not bundling the JRE then there's no point in not just distributing a jar.
– chrylis
Jan 1 at 7:25
I am aware of course that JRE is needed to run Java applications, but none of my users had problems downloading and installing JRE manually, so i see no need to bundle a JRE with my application. I just want to have an executable with my application to be user friendly for Linux users, just like an *.exe file in Windows operating system.
– Brad
Jan 3 at 7:49