Visual Studio Code, Java Extension, howto add jar to classpathSetting the classpath in a Visual Studio Code Maven-based Java projectVisual Studio Java Language Support add jarIncluding all the jars in a directory within the Java classpathCan I add jars to maven 2 build classpath without installing them?How to avoid Java code in JSP files?How to add local jar files to a Maven project?Multiple cursors in Visual Studio CodeVertical rulers in Visual Studio Code?How do you format code in Visual Studio Code (VSCode)How do I collapse sections of code in Visual Studio Code for Windows?Why is executing Java code in comments with certain Unicode characters allowed?Visual Studio code external jars and tomcat jars to classpath

Why Is Death Allowed In the Matrix?

Problem of parity - Can we draw a closed path made up of 20 line segments...

Why do I get two different answers for this counting problem?

To string or not to string

Why "Having chlorophyll without photosynthesis is actually very dangerous" and "like living with a bomb"?

Why was the small council so happy for Tyrion to become the Master of Coin?

How to format long polynomial?

How to write a macro that is braces sensitive?

How old can references or sources in a thesis be?

Is it tax fraud for an individual to declare non-taxable revenue as taxable income? (US tax laws)

Example of a continuous function that don't have a continuous extension

Are the number of citations and number of published articles the most important criteria for a tenure promotion?

Test if tikzmark exists on same page

The Two and the One

Modeling an IPv4 Address

Risk of getting Chronic Wasting Disease (CWD) in the United States?

What is the word for reserving something for yourself before others do?

Animated Series: Alien black spider robot crashes on Earth

Why did the Germans forbid the possession of pet pigeons in Rostov-on-Don in 1941?

Why do falling prices hurt debtors?

What does it mean to describe someone as a butt steak?

Email Account under attack (really) - anything I can do?

How do we improve the relationship with a client software team that performs poorly and is becoming less collaborative?

TGV timetables / schedules?



Visual Studio Code, Java Extension, howto add jar to classpath


Setting the classpath in a Visual Studio Code Maven-based Java projectVisual Studio Java Language Support add jarIncluding all the jars in a directory within the Java classpathCan I add jars to maven 2 build classpath without installing them?How to avoid Java code in JSP files?How to add local jar files to a Maven project?Multiple cursors in Visual Studio CodeVertical rulers in Visual Studio Code?How do you format code in Visual Studio Code (VSCode)How do I collapse sections of code in Visual Studio Code for Windows?Why is executing Java code in comments with certain Unicode characters allowed?Visual Studio code external jars and tomcat jars to classpath






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








11















In Eclipse, I add a jar library using



project -> build path ->configure build path



What is the equivalent in VisualStudioCode? I had a look into launch.json. There is a classpath defined. Adding jars to this classpath (array) variable seems to have no effect.



Essentially, this is a duplicate question of
Visual Studio Java Language Support add jar
But that question is unanswered.



This is such an extremely basic question, that I really don't understand not to find a solution for it in Microsoft's documentation or via Google search.










share|improve this question






















  • visual studio code is a text editor its not an ide so your system variables(if you are on windows) will have class path for your java and other libraries

    – Shubh Dixit
    May 8 '18 at 11:33











  • Start here, I haven't read it completely but you can find useful info code.visualstudio.com/docs/java/java-tutorial

    – Victor Herasme Perez
    May 8 '18 at 11:34











  • This is not a duplicate since the question was about Visual Studio, not Visual Studio Code

    – C.Champagne
    May 8 '18 at 11:34











  • Thanks for this hint. I tried to do: export CLASSPATH=<list of jar files>, then started visual studio code with this environment variable, but the problems stays the same: build fails.

    – gqp21
    May 8 '18 at 11:44












  • I am not sure that vscode is really adapted for Java development but anyway this will depend on which extension you will install to develop in Java. What have you installed??? Furthermore, whatever the one you chose, I suggest you to use Maven or Gradle to manage you dependencies.

    – C.Champagne
    May 8 '18 at 11:48

















11















In Eclipse, I add a jar library using



project -> build path ->configure build path



What is the equivalent in VisualStudioCode? I had a look into launch.json. There is a classpath defined. Adding jars to this classpath (array) variable seems to have no effect.



Essentially, this is a duplicate question of
Visual Studio Java Language Support add jar
But that question is unanswered.



This is such an extremely basic question, that I really don't understand not to find a solution for it in Microsoft's documentation or via Google search.










share|improve this question






















  • visual studio code is a text editor its not an ide so your system variables(if you are on windows) will have class path for your java and other libraries

    – Shubh Dixit
    May 8 '18 at 11:33











  • Start here, I haven't read it completely but you can find useful info code.visualstudio.com/docs/java/java-tutorial

    – Victor Herasme Perez
    May 8 '18 at 11:34











  • This is not a duplicate since the question was about Visual Studio, not Visual Studio Code

    – C.Champagne
    May 8 '18 at 11:34











  • Thanks for this hint. I tried to do: export CLASSPATH=<list of jar files>, then started visual studio code with this environment variable, but the problems stays the same: build fails.

    – gqp21
    May 8 '18 at 11:44












  • I am not sure that vscode is really adapted for Java development but anyway this will depend on which extension you will install to develop in Java. What have you installed??? Furthermore, whatever the one you chose, I suggest you to use Maven or Gradle to manage you dependencies.

    – C.Champagne
    May 8 '18 at 11:48













11












11








11


3






In Eclipse, I add a jar library using



project -> build path ->configure build path



What is the equivalent in VisualStudioCode? I had a look into launch.json. There is a classpath defined. Adding jars to this classpath (array) variable seems to have no effect.



Essentially, this is a duplicate question of
Visual Studio Java Language Support add jar
But that question is unanswered.



This is such an extremely basic question, that I really don't understand not to find a solution for it in Microsoft's documentation or via Google search.










share|improve this question














In Eclipse, I add a jar library using



project -> build path ->configure build path



What is the equivalent in VisualStudioCode? I had a look into launch.json. There is a classpath defined. Adding jars to this classpath (array) variable seems to have no effect.



Essentially, this is a duplicate question of
Visual Studio Java Language Support add jar
But that question is unanswered.



This is such an extremely basic question, that I really don't understand not to find a solution for it in Microsoft's documentation or via Google search.







java visual-studio-code






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked May 8 '18 at 11:30









gqp21gqp21

5613




5613












  • visual studio code is a text editor its not an ide so your system variables(if you are on windows) will have class path for your java and other libraries

    – Shubh Dixit
    May 8 '18 at 11:33











  • Start here, I haven't read it completely but you can find useful info code.visualstudio.com/docs/java/java-tutorial

    – Victor Herasme Perez
    May 8 '18 at 11:34











  • This is not a duplicate since the question was about Visual Studio, not Visual Studio Code

    – C.Champagne
    May 8 '18 at 11:34











  • Thanks for this hint. I tried to do: export CLASSPATH=<list of jar files>, then started visual studio code with this environment variable, but the problems stays the same: build fails.

    – gqp21
    May 8 '18 at 11:44












  • I am not sure that vscode is really adapted for Java development but anyway this will depend on which extension you will install to develop in Java. What have you installed??? Furthermore, whatever the one you chose, I suggest you to use Maven or Gradle to manage you dependencies.

    – C.Champagne
    May 8 '18 at 11:48

















  • visual studio code is a text editor its not an ide so your system variables(if you are on windows) will have class path for your java and other libraries

    – Shubh Dixit
    May 8 '18 at 11:33











  • Start here, I haven't read it completely but you can find useful info code.visualstudio.com/docs/java/java-tutorial

    – Victor Herasme Perez
    May 8 '18 at 11:34











  • This is not a duplicate since the question was about Visual Studio, not Visual Studio Code

    – C.Champagne
    May 8 '18 at 11:34











  • Thanks for this hint. I tried to do: export CLASSPATH=<list of jar files>, then started visual studio code with this environment variable, but the problems stays the same: build fails.

    – gqp21
    May 8 '18 at 11:44












  • I am not sure that vscode is really adapted for Java development but anyway this will depend on which extension you will install to develop in Java. What have you installed??? Furthermore, whatever the one you chose, I suggest you to use Maven or Gradle to manage you dependencies.

    – C.Champagne
    May 8 '18 at 11:48
















visual studio code is a text editor its not an ide so your system variables(if you are on windows) will have class path for your java and other libraries

– Shubh Dixit
May 8 '18 at 11:33





visual studio code is a text editor its not an ide so your system variables(if you are on windows) will have class path for your java and other libraries

– Shubh Dixit
May 8 '18 at 11:33













Start here, I haven't read it completely but you can find useful info code.visualstudio.com/docs/java/java-tutorial

– Victor Herasme Perez
May 8 '18 at 11:34





Start here, I haven't read it completely but you can find useful info code.visualstudio.com/docs/java/java-tutorial

– Victor Herasme Perez
May 8 '18 at 11:34













This is not a duplicate since the question was about Visual Studio, not Visual Studio Code

– C.Champagne
May 8 '18 at 11:34





This is not a duplicate since the question was about Visual Studio, not Visual Studio Code

– C.Champagne
May 8 '18 at 11:34













Thanks for this hint. I tried to do: export CLASSPATH=<list of jar files>, then started visual studio code with this environment variable, but the problems stays the same: build fails.

– gqp21
May 8 '18 at 11:44






Thanks for this hint. I tried to do: export CLASSPATH=<list of jar files>, then started visual studio code with this environment variable, but the problems stays the same: build fails.

– gqp21
May 8 '18 at 11:44














I am not sure that vscode is really adapted for Java development but anyway this will depend on which extension you will install to develop in Java. What have you installed??? Furthermore, whatever the one you chose, I suggest you to use Maven or Gradle to manage you dependencies.

– C.Champagne
May 8 '18 at 11:48





I am not sure that vscode is really adapted for Java development but anyway this will depend on which extension you will install to develop in Java. What have you installed??? Furthermore, whatever the one you chose, I suggest you to use Maven or Gradle to manage you dependencies.

– C.Champagne
May 8 '18 at 11:48












2 Answers
2






active

oldest

votes


















0














A terrible solution, but for me it works.
(Assuming maven is installed).



Locate your maven repository directory, for me it is:



/Users/username/.m2/repository



Then create the path required following the package name.
If you don't know the package name you can rename the .jar to a .zip and extract the content.



Also create a version number, if you don't have one then make one up.
Here is a example of a structure that I created for byte-buddy-agent since that does not have a maven snippet.



Having done that you edit pom.xml and add something among the lines of:



<dependency>
<groupId>net.bytebuddyagent</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>1.9.8</version>
</dependency>


Save the file, reload the changes, and you should be good to go.
A bunch of files should be created in the directory.



enter image description here






share|improve this answer






























    0














    VSCode works fine with maven or gradle. But without those, as far as I know they have not provided any direct way to add jar file in classpath.



    The workaround is to add the entry in .classpath file manually.



    For e.g. in below file I have added common-logging-1.2.jar manually.



    <?xml version="1.0" encoding="UTF-8"?>
    <classpath>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="output" path="bin"/>
    <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.2.jar"/>
    </classpath>





    share|improve this answer























    • Created github.com/Microsoft/vscode-java-pack/issues/94 for fixing it

      – Hemang
      Feb 5 at 13:21











    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%2f50232557%2fvisual-studio-code-java-extension-howto-add-jar-to-classpath%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    A terrible solution, but for me it works.
    (Assuming maven is installed).



    Locate your maven repository directory, for me it is:



    /Users/username/.m2/repository



    Then create the path required following the package name.
    If you don't know the package name you can rename the .jar to a .zip and extract the content.



    Also create a version number, if you don't have one then make one up.
    Here is a example of a structure that I created for byte-buddy-agent since that does not have a maven snippet.



    Having done that you edit pom.xml and add something among the lines of:



    <dependency>
    <groupId>net.bytebuddyagent</groupId>
    <artifactId>byte-buddy-agent</artifactId>
    <version>1.9.8</version>
    </dependency>


    Save the file, reload the changes, and you should be good to go.
    A bunch of files should be created in the directory.



    enter image description here






    share|improve this answer



























      0














      A terrible solution, but for me it works.
      (Assuming maven is installed).



      Locate your maven repository directory, for me it is:



      /Users/username/.m2/repository



      Then create the path required following the package name.
      If you don't know the package name you can rename the .jar to a .zip and extract the content.



      Also create a version number, if you don't have one then make one up.
      Here is a example of a structure that I created for byte-buddy-agent since that does not have a maven snippet.



      Having done that you edit pom.xml and add something among the lines of:



      <dependency>
      <groupId>net.bytebuddyagent</groupId>
      <artifactId>byte-buddy-agent</artifactId>
      <version>1.9.8</version>
      </dependency>


      Save the file, reload the changes, and you should be good to go.
      A bunch of files should be created in the directory.



      enter image description here






      share|improve this answer

























        0












        0








        0







        A terrible solution, but for me it works.
        (Assuming maven is installed).



        Locate your maven repository directory, for me it is:



        /Users/username/.m2/repository



        Then create the path required following the package name.
        If you don't know the package name you can rename the .jar to a .zip and extract the content.



        Also create a version number, if you don't have one then make one up.
        Here is a example of a structure that I created for byte-buddy-agent since that does not have a maven snippet.



        Having done that you edit pom.xml and add something among the lines of:



        <dependency>
        <groupId>net.bytebuddyagent</groupId>
        <artifactId>byte-buddy-agent</artifactId>
        <version>1.9.8</version>
        </dependency>


        Save the file, reload the changes, and you should be good to go.
        A bunch of files should be created in the directory.



        enter image description here






        share|improve this answer













        A terrible solution, but for me it works.
        (Assuming maven is installed).



        Locate your maven repository directory, for me it is:



        /Users/username/.m2/repository



        Then create the path required following the package name.
        If you don't know the package name you can rename the .jar to a .zip and extract the content.



        Also create a version number, if you don't have one then make one up.
        Here is a example of a structure that I created for byte-buddy-agent since that does not have a maven snippet.



        Having done that you edit pom.xml and add something among the lines of:



        <dependency>
        <groupId>net.bytebuddyagent</groupId>
        <artifactId>byte-buddy-agent</artifactId>
        <version>1.9.8</version>
        </dependency>


        Save the file, reload the changes, and you should be good to go.
        A bunch of files should be created in the directory.



        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 28 at 20:08









        clankill3rclankill3r

        3,023125190




        3,023125190























            0














            VSCode works fine with maven or gradle. But without those, as far as I know they have not provided any direct way to add jar file in classpath.



            The workaround is to add the entry in .classpath file manually.



            For e.g. in below file I have added common-logging-1.2.jar manually.



            <?xml version="1.0" encoding="UTF-8"?>
            <classpath>
            <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
            <classpathentry kind="src" path="src"/>
            <classpathentry kind="output" path="bin"/>
            <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.2.jar"/>
            </classpath>





            share|improve this answer























            • Created github.com/Microsoft/vscode-java-pack/issues/94 for fixing it

              – Hemang
              Feb 5 at 13:21















            0














            VSCode works fine with maven or gradle. But without those, as far as I know they have not provided any direct way to add jar file in classpath.



            The workaround is to add the entry in .classpath file manually.



            For e.g. in below file I have added common-logging-1.2.jar manually.



            <?xml version="1.0" encoding="UTF-8"?>
            <classpath>
            <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
            <classpathentry kind="src" path="src"/>
            <classpathentry kind="output" path="bin"/>
            <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.2.jar"/>
            </classpath>





            share|improve this answer























            • Created github.com/Microsoft/vscode-java-pack/issues/94 for fixing it

              – Hemang
              Feb 5 at 13:21













            0












            0








            0







            VSCode works fine with maven or gradle. But without those, as far as I know they have not provided any direct way to add jar file in classpath.



            The workaround is to add the entry in .classpath file manually.



            For e.g. in below file I have added common-logging-1.2.jar manually.



            <?xml version="1.0" encoding="UTF-8"?>
            <classpath>
            <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
            <classpathentry kind="src" path="src"/>
            <classpathentry kind="output" path="bin"/>
            <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.2.jar"/>
            </classpath>





            share|improve this answer













            VSCode works fine with maven or gradle. But without those, as far as I know they have not provided any direct way to add jar file in classpath.



            The workaround is to add the entry in .classpath file manually.



            For e.g. in below file I have added common-logging-1.2.jar manually.



            <?xml version="1.0" encoding="UTF-8"?>
            <classpath>
            <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
            <classpathentry kind="src" path="src"/>
            <classpathentry kind="output" path="bin"/>
            <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.2.jar"/>
            </classpath>






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Feb 5 at 13:16









            HemangHemang

            80110




            80110












            • Created github.com/Microsoft/vscode-java-pack/issues/94 for fixing it

              – Hemang
              Feb 5 at 13:21

















            • Created github.com/Microsoft/vscode-java-pack/issues/94 for fixing it

              – Hemang
              Feb 5 at 13:21
















            Created github.com/Microsoft/vscode-java-pack/issues/94 for fixing it

            – Hemang
            Feb 5 at 13:21





            Created github.com/Microsoft/vscode-java-pack/issues/94 for fixing it

            – Hemang
            Feb 5 at 13:21

















            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%2f50232557%2fvisual-studio-code-java-extension-howto-add-jar-to-classpath%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

            Thal And Out Agency railway station See also References External links Navigation menuOfficial Web Site of Pakistan RailwaysArchivedOfficial Web Site of Pakistan Railwayseeexpanding ite

            Understanding generators in Python2019 Community Moderator ElectionGenerator function not working pythonFor loop not executing two timesGenerators - Printing generated valuesWhy can a python generator only be used once?What exactly do generators do?What does the “yield” keyword do?What does “list comprehension” mean? How does it work and how can I use it?sklearn Kfold acces single fold instead of for loopIs a generator the callable? Which is the generator?Apply Border To Range Of Cells Using OpenpyxlCalling an external command in PythonWhat are metaclasses in Python?What is the difference between @staticmethod and @classmethod?Finding the index of an item given a list containing it in PythonDifference between append vs. extend list methods in PythonHow can I safely create a nested directory in Python?Does Python have a ternary conditional operator?Understanding slice notationUnderstanding Python super() with __init__() methodsDoes Python have a string 'contains' substring method?

            How can I change the color of pagination dots of UIPageControl?How to change UIPageControl dotsIs there a way to change page indicator dots colorCustomize dot with image of UIPageControl at index 0 of UIPageControlNo visible @interface for 'NSObject<PageControlDelegate>' declares the selector 'pageControlPageDidChange:'How to change the color of pagination dots in UIPageControl with a different color per pagepagecontrol indicator custom image instead of DefaultChanging the colour of UIPageControl dots in MonoTouchpagecontrol selectable page visibility color?Alternative way to load ViewControllers on a UIPageControlHow to set only layer.border-color for UIpage control dots in swiftHow can I develop for iPhone using a Windows development machine?How to change the name of an iOS app?UITableView - change section header coloruipagecontrol indicator(dot)issueCustom UIPageControl dots color not changingchange the interspace between UIPageControl dotsHow to change Status Bar text color in iOSHow can I change image tintColor in iOS and WatchKitUIPageControl dots with larger space in between each dotsHow to change the color of pagination dots in UIPageControl with a different color per page