Add additional .jar libraries when creating a runnable .jar via command lineSystem.out not working when calling jar-file from Windows command lineHow to create a .jar file or export jar on IntelliJ (like eclipse java archive export)IntelliJ inspection gives “Cannot resolve symbol” but still compiles codePassing on command line arguments to runnable JARHow to control folder structure when exporting a Runnable JAR in Eclipse?Eclipse: Create Runnable .jar WITH manifest possible?Creating Runnable Jar with external files includedRun a JAR file from the command line and specify classpathHow to create runnable jar with resources in Eclipse from Maven projectEclipse export runnable jar with main class inside a library jar
Why does AES have exactly 10 rounds for a 128-bit key, 12 for 192 bits and 14 for a 256-bit key size?
Does "he squandered his car on drink" sound natural?
Shouldn’t conservatives embrace universal basic income?
Pre-mixing cryogenic fuels and using only one fuel tank
What to do when eye contact makes your coworker uncomfortable?
How do you make your own symbol when Detexify fails?
Quoting Keynes in a lecture
Is this part of the description of the Archfey warlock's Misty Escape feature redundant?
Why should universal income be universal?
What does "Scientists rise up against statistical significance" mean? (Comment in Nature)
Is it necessary to use pronouns with the verb "essere"?
How many arrows is an archer expected to fire by the end of the Tyranny of Dragons pair of adventures?
How much of a Devil Fruit must be consumed to gain the power?
Are Captain Marvel's powers affected by Thanos breaking the Tesseract and claiming the stone?
Taxes on Dividends in a Roth IRA
Why Shazam when there is already Superman?
What is the difference between lands and mana?
A Trivial Diagnosis
Change the color of a single dot in `ddot` symbol
Will number of steps recorded on FitBit/any fitness tracker add up distance in PokemonGo?
How to explain what's wrong with this application of the chain rule?
Is this toilet slogan correct usage of the English language?
What is the highest possible scrabble score for placing a single tile
What (the heck) is a Super Worm Equinox Moon?
Add additional .jar libraries when creating a runnable .jar via command line
System.out not working when calling jar-file from Windows command lineHow to create a .jar file or export jar on IntelliJ (like eclipse java archive export)IntelliJ inspection gives “Cannot resolve symbol” but still compiles codePassing on command line arguments to runnable JARHow to control folder structure when exporting a Runnable JAR in Eclipse?Eclipse: Create Runnable .jar WITH manifest possible?Creating Runnable Jar with external files includedRun a JAR file from the command line and specify classpathHow to create runnable jar with resources in Eclipse from Maven projectEclipse export runnable jar with main class inside a library jar
Am working to reproduce the "export runnable .jar file" functionality of Eclipse with command-line calls directly from the java program itself.
So those commands shall execute after Eclipse has compiled the project. I need this for better control what files are ending up in the .jar and to speed up the development process.
The following command successfully packs the structure and classes from the "bin" directory and also creates a manifest.mf file with the correct main class so the myjar.jar is runnable.
ProcessBuilder builder = new ProcessBuilder("jar", "cvfe", "myjar.jar", "main.MainControler", "-C", "bin", "/");
Process process = builder.start();
However my project has several libraries (.jar files) added to the classpath via the class-path dialogues of Eclipse. For example I'm using the pi4j library.
I expected that that its internal directory and class structure (something like "com.pi4j.***.class") would be added to the "bin" directory when eclipse compiles and executes the program.
However it is not there and therefore that never ends up in the "myjar.jar" either (and I get class-missing errors when running the .jar).
When I use Eclipse' export function, the files are there though.
What do I need to do to have the .class files from the additional .jar libraries exported so they can be added?
Huge thanks in advance :)
java eclipse jar executable-jar
add a comment |
Am working to reproduce the "export runnable .jar file" functionality of Eclipse with command-line calls directly from the java program itself.
So those commands shall execute after Eclipse has compiled the project. I need this for better control what files are ending up in the .jar and to speed up the development process.
The following command successfully packs the structure and classes from the "bin" directory and also creates a manifest.mf file with the correct main class so the myjar.jar is runnable.
ProcessBuilder builder = new ProcessBuilder("jar", "cvfe", "myjar.jar", "main.MainControler", "-C", "bin", "/");
Process process = builder.start();
However my project has several libraries (.jar files) added to the classpath via the class-path dialogues of Eclipse. For example I'm using the pi4j library.
I expected that that its internal directory and class structure (something like "com.pi4j.***.class") would be added to the "bin" directory when eclipse compiles and executes the program.
However it is not there and therefore that never ends up in the "myjar.jar" either (and I get class-missing errors when running the .jar).
When I use Eclipse' export function, the files are there though.
What do I need to do to have the .class files from the additional .jar libraries exported so they can be added?
Huge thanks in advance :)
java eclipse jar executable-jar
Which problem would you like to solve? Maybe you can elaborate on "I need this for better control what files are ending up in the .jar and to speed up the development process"?
– thokuest
16 hours ago
add a comment |
Am working to reproduce the "export runnable .jar file" functionality of Eclipse with command-line calls directly from the java program itself.
So those commands shall execute after Eclipse has compiled the project. I need this for better control what files are ending up in the .jar and to speed up the development process.
The following command successfully packs the structure and classes from the "bin" directory and also creates a manifest.mf file with the correct main class so the myjar.jar is runnable.
ProcessBuilder builder = new ProcessBuilder("jar", "cvfe", "myjar.jar", "main.MainControler", "-C", "bin", "/");
Process process = builder.start();
However my project has several libraries (.jar files) added to the classpath via the class-path dialogues of Eclipse. For example I'm using the pi4j library.
I expected that that its internal directory and class structure (something like "com.pi4j.***.class") would be added to the "bin" directory when eclipse compiles and executes the program.
However it is not there and therefore that never ends up in the "myjar.jar" either (and I get class-missing errors when running the .jar).
When I use Eclipse' export function, the files are there though.
What do I need to do to have the .class files from the additional .jar libraries exported so they can be added?
Huge thanks in advance :)
java eclipse jar executable-jar
Am working to reproduce the "export runnable .jar file" functionality of Eclipse with command-line calls directly from the java program itself.
So those commands shall execute after Eclipse has compiled the project. I need this for better control what files are ending up in the .jar and to speed up the development process.
The following command successfully packs the structure and classes from the "bin" directory and also creates a manifest.mf file with the correct main class so the myjar.jar is runnable.
ProcessBuilder builder = new ProcessBuilder("jar", "cvfe", "myjar.jar", "main.MainControler", "-C", "bin", "/");
Process process = builder.start();
However my project has several libraries (.jar files) added to the classpath via the class-path dialogues of Eclipse. For example I'm using the pi4j library.
I expected that that its internal directory and class structure (something like "com.pi4j.***.class") would be added to the "bin" directory when eclipse compiles and executes the program.
However it is not there and therefore that never ends up in the "myjar.jar" either (and I get class-missing errors when running the .jar).
When I use Eclipse' export function, the files are there though.
What do I need to do to have the .class files from the additional .jar libraries exported so they can be added?
Huge thanks in advance :)
java eclipse jar executable-jar
java eclipse jar executable-jar
edited 18 hours ago
DragonGamer
asked 18 hours ago
DragonGamerDragonGamer
3191517
3191517
Which problem would you like to solve? Maybe you can elaborate on "I need this for better control what files are ending up in the .jar and to speed up the development process"?
– thokuest
16 hours ago
add a comment |
Which problem would you like to solve? Maybe you can elaborate on "I need this for better control what files are ending up in the .jar and to speed up the development process"?
– thokuest
16 hours ago
Which problem would you like to solve? Maybe you can elaborate on "I need this for better control what files are ending up in the .jar and to speed up the development process"?
– thokuest
16 hours ago
Which problem would you like to solve? Maybe you can elaborate on "I need this for better control what files are ending up in the .jar and to speed up the development process"?
– thokuest
16 hours ago
add a comment |
1 Answer
1
active
oldest
votes
Your problem statement is not very clear and gives me the impression that you are trying to do something that should not be done.
First of all: if you don't want to use Eclipse to build the project then avoid using it to perform the first part of the work (i.e. compilation): you can perform the whole process from command line and this will give you even more control on the build process.
Second suggestion: do not reinvent the wheel. If you want to build from command line you can use Ant or Maven. In particular you can use Eclipse to generate an Ant build script that performs like "export runnable .jar file" then you can customize that script as you want: in Eclipse right-click on the project then select
Export / General / Ant Buildfiles
and you'll get a build.xml
script to be used with Ant.
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%2f55277368%2fadd-additional-jar-libraries-when-creating-a-runnable-jar-via-command-line%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
Your problem statement is not very clear and gives me the impression that you are trying to do something that should not be done.
First of all: if you don't want to use Eclipse to build the project then avoid using it to perform the first part of the work (i.e. compilation): you can perform the whole process from command line and this will give you even more control on the build process.
Second suggestion: do not reinvent the wheel. If you want to build from command line you can use Ant or Maven. In particular you can use Eclipse to generate an Ant build script that performs like "export runnable .jar file" then you can customize that script as you want: in Eclipse right-click on the project then select
Export / General / Ant Buildfiles
and you'll get a build.xml
script to be used with Ant.
add a comment |
Your problem statement is not very clear and gives me the impression that you are trying to do something that should not be done.
First of all: if you don't want to use Eclipse to build the project then avoid using it to perform the first part of the work (i.e. compilation): you can perform the whole process from command line and this will give you even more control on the build process.
Second suggestion: do not reinvent the wheel. If you want to build from command line you can use Ant or Maven. In particular you can use Eclipse to generate an Ant build script that performs like "export runnable .jar file" then you can customize that script as you want: in Eclipse right-click on the project then select
Export / General / Ant Buildfiles
and you'll get a build.xml
script to be used with Ant.
add a comment |
Your problem statement is not very clear and gives me the impression that you are trying to do something that should not be done.
First of all: if you don't want to use Eclipse to build the project then avoid using it to perform the first part of the work (i.e. compilation): you can perform the whole process from command line and this will give you even more control on the build process.
Second suggestion: do not reinvent the wheel. If you want to build from command line you can use Ant or Maven. In particular you can use Eclipse to generate an Ant build script that performs like "export runnable .jar file" then you can customize that script as you want: in Eclipse right-click on the project then select
Export / General / Ant Buildfiles
and you'll get a build.xml
script to be used with Ant.
Your problem statement is not very clear and gives me the impression that you are trying to do something that should not be done.
First of all: if you don't want to use Eclipse to build the project then avoid using it to perform the first part of the work (i.e. compilation): you can perform the whole process from command line and this will give you even more control on the build process.
Second suggestion: do not reinvent the wheel. If you want to build from command line you can use Ant or Maven. In particular you can use Eclipse to generate an Ant build script that performs like "export runnable .jar file" then you can customize that script as you want: in Eclipse right-click on the project then select
Export / General / Ant Buildfiles
and you'll get a build.xml
script to be used with Ant.
edited 14 hours ago
answered 15 hours ago
PinoPino
4,95033051
4,95033051
add a comment |
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%2f55277368%2fadd-additional-jar-libraries-when-creating-a-runnable-jar-via-command-line%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
Which problem would you like to solve? Maybe you can elaborate on "I need this for better control what files are ending up in the .jar and to speed up the development process"?
– thokuest
16 hours ago