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













0















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 :)










share|improve this question
























  • 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















0















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 :)










share|improve this question
























  • 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













0












0








0








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 :)










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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

















  • 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












1 Answer
1






active

oldest

votes


















0














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.






share|improve this answer
























    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
    );



    );













    draft saved

    draft discarded


















    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









    0














    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.






    share|improve this answer





























      0














      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.






      share|improve this answer



























        0












        0








        0







        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.






        share|improve this answer















        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.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 14 hours ago

























        answered 15 hours ago









        PinoPino

        4,95033051




        4,95033051





























            draft saved

            draft discarded
















































            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.




            draft saved


            draft discarded














            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





















































            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







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript