Visual Studio Code import Library












0















I'm using Visual Studio Code for Java and I want to debug my code while using a Library. But whenever I start debugging I'm getting the following error:



Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
IO cannot be resolved
IO cannot be resolved
IO cannot be resolved

at TestClass.main(TestClass.java:6)


for example with the following code:



import AlgoTools.IO;

public class TestClass {
public static void main(String args) {
int a, b;
a = IO.readInt("Please enter a number ");
b = IO.readInt("Please enter another number ");

IO.println("Your number is: " + (a + b));
}
}


But when I compile my code in cmd or PowerShell using javac <Filename> and running it with java <Classname> it works fine. I'm only getting errors when I try to debug in Visual Studio Code.



I should also mention, that I added the path to my .jar Libary in my CLASSPATH.



I'm using the default "Launch" debugging configuration:



{
"type": "java",
"name": "Debug (Launch)",
"request": "launch",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopOnEntry": false,
"mainClass": "",
"args": ""
},









share|improve this question























  • Possible duplicate of Setting the classpath in a Visual Studio Code Maven-based Java project

    – Robin Green
    Nov 25 '18 at 11:52











  • I don't use maven, I don't even know how I should use it. I just want to debug some code for school in VSC. Or do you recommend using maven and when you do, why?

    – Moritz
    Nov 25 '18 at 12:30











  • Ok, I read a little bit about Maven and I should add, that you can't find the Libary in the maven archives (as far as I know), because it's a library from our university.

    – Moritz
    Nov 25 '18 at 14:40











  • I think the answer to that question is applicable even if you don't use Maven.

    – Robin Green
    Nov 25 '18 at 15:17
















0















I'm using Visual Studio Code for Java and I want to debug my code while using a Library. But whenever I start debugging I'm getting the following error:



Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
IO cannot be resolved
IO cannot be resolved
IO cannot be resolved

at TestClass.main(TestClass.java:6)


for example with the following code:



import AlgoTools.IO;

public class TestClass {
public static void main(String args) {
int a, b;
a = IO.readInt("Please enter a number ");
b = IO.readInt("Please enter another number ");

IO.println("Your number is: " + (a + b));
}
}


But when I compile my code in cmd or PowerShell using javac <Filename> and running it with java <Classname> it works fine. I'm only getting errors when I try to debug in Visual Studio Code.



I should also mention, that I added the path to my .jar Libary in my CLASSPATH.



I'm using the default "Launch" debugging configuration:



{
"type": "java",
"name": "Debug (Launch)",
"request": "launch",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopOnEntry": false,
"mainClass": "",
"args": ""
},









share|improve this question























  • Possible duplicate of Setting the classpath in a Visual Studio Code Maven-based Java project

    – Robin Green
    Nov 25 '18 at 11:52











  • I don't use maven, I don't even know how I should use it. I just want to debug some code for school in VSC. Or do you recommend using maven and when you do, why?

    – Moritz
    Nov 25 '18 at 12:30











  • Ok, I read a little bit about Maven and I should add, that you can't find the Libary in the maven archives (as far as I know), because it's a library from our university.

    – Moritz
    Nov 25 '18 at 14:40











  • I think the answer to that question is applicable even if you don't use Maven.

    – Robin Green
    Nov 25 '18 at 15:17














0












0








0








I'm using Visual Studio Code for Java and I want to debug my code while using a Library. But whenever I start debugging I'm getting the following error:



Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
IO cannot be resolved
IO cannot be resolved
IO cannot be resolved

at TestClass.main(TestClass.java:6)


for example with the following code:



import AlgoTools.IO;

public class TestClass {
public static void main(String args) {
int a, b;
a = IO.readInt("Please enter a number ");
b = IO.readInt("Please enter another number ");

IO.println("Your number is: " + (a + b));
}
}


But when I compile my code in cmd or PowerShell using javac <Filename> and running it with java <Classname> it works fine. I'm only getting errors when I try to debug in Visual Studio Code.



I should also mention, that I added the path to my .jar Libary in my CLASSPATH.



I'm using the default "Launch" debugging configuration:



{
"type": "java",
"name": "Debug (Launch)",
"request": "launch",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopOnEntry": false,
"mainClass": "",
"args": ""
},









share|improve this question














I'm using Visual Studio Code for Java and I want to debug my code while using a Library. But whenever I start debugging I'm getting the following error:



Exception in thread "main" java.lang.Error: Unresolved compilation problems: 
IO cannot be resolved
IO cannot be resolved
IO cannot be resolved

at TestClass.main(TestClass.java:6)


for example with the following code:



import AlgoTools.IO;

public class TestClass {
public static void main(String args) {
int a, b;
a = IO.readInt("Please enter a number ");
b = IO.readInt("Please enter another number ");

IO.println("Your number is: " + (a + b));
}
}


But when I compile my code in cmd or PowerShell using javac <Filename> and running it with java <Classname> it works fine. I'm only getting errors when I try to debug in Visual Studio Code.



I should also mention, that I added the path to my .jar Libary in my CLASSPATH.



I'm using the default "Launch" debugging configuration:



{
"type": "java",
"name": "Debug (Launch)",
"request": "launch",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopOnEntry": false,
"mainClass": "",
"args": ""
},






java visual-studio-code






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 25 '18 at 11:39









MoritzMoritz

1715




1715













  • Possible duplicate of Setting the classpath in a Visual Studio Code Maven-based Java project

    – Robin Green
    Nov 25 '18 at 11:52











  • I don't use maven, I don't even know how I should use it. I just want to debug some code for school in VSC. Or do you recommend using maven and when you do, why?

    – Moritz
    Nov 25 '18 at 12:30











  • Ok, I read a little bit about Maven and I should add, that you can't find the Libary in the maven archives (as far as I know), because it's a library from our university.

    – Moritz
    Nov 25 '18 at 14:40











  • I think the answer to that question is applicable even if you don't use Maven.

    – Robin Green
    Nov 25 '18 at 15:17



















  • Possible duplicate of Setting the classpath in a Visual Studio Code Maven-based Java project

    – Robin Green
    Nov 25 '18 at 11:52











  • I don't use maven, I don't even know how I should use it. I just want to debug some code for school in VSC. Or do you recommend using maven and when you do, why?

    – Moritz
    Nov 25 '18 at 12:30











  • Ok, I read a little bit about Maven and I should add, that you can't find the Libary in the maven archives (as far as I know), because it's a library from our university.

    – Moritz
    Nov 25 '18 at 14:40











  • I think the answer to that question is applicable even if you don't use Maven.

    – Robin Green
    Nov 25 '18 at 15:17

















Possible duplicate of Setting the classpath in a Visual Studio Code Maven-based Java project

– Robin Green
Nov 25 '18 at 11:52





Possible duplicate of Setting the classpath in a Visual Studio Code Maven-based Java project

– Robin Green
Nov 25 '18 at 11:52













I don't use maven, I don't even know how I should use it. I just want to debug some code for school in VSC. Or do you recommend using maven and when you do, why?

– Moritz
Nov 25 '18 at 12:30





I don't use maven, I don't even know how I should use it. I just want to debug some code for school in VSC. Or do you recommend using maven and when you do, why?

– Moritz
Nov 25 '18 at 12:30













Ok, I read a little bit about Maven and I should add, that you can't find the Libary in the maven archives (as far as I know), because it's a library from our university.

– Moritz
Nov 25 '18 at 14:40





Ok, I read a little bit about Maven and I should add, that you can't find the Libary in the maven archives (as far as I know), because it's a library from our university.

– Moritz
Nov 25 '18 at 14:40













I think the answer to that question is applicable even if you don't use Maven.

– Robin Green
Nov 25 '18 at 15:17





I think the answer to that question is applicable even if you don't use Maven.

– Robin Green
Nov 25 '18 at 15:17












1 Answer
1






active

oldest

votes


















0














you should install a extension called "java extension pack" and java maven. or install that offline extension.click here and get extension name



Extension URL : https://marketplace.visualstudio.com/_apis/public/gallery/publishers/vscjava/vsextensions/vscode-java-pack/0.4.0/vspackage






share|improve this answer
























  • I already installed the java extension pack. and Java Maven is in the expansion pack, so I already installed it but I don't really know how to use Maven.

    – Moritz
    Nov 25 '18 at 12:32











  • go to menu bar and select debug menu and click start without debugging.

    – Atul Kumar
    Nov 25 '18 at 16:25











  • I'm getting the same error. Besides that, I want to use the debug features of VSC.

    – Moritz
    Nov 25 '18 at 20:51











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%2f53467054%2fvisual-studio-code-import-library%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














you should install a extension called "java extension pack" and java maven. or install that offline extension.click here and get extension name



Extension URL : https://marketplace.visualstudio.com/_apis/public/gallery/publishers/vscjava/vsextensions/vscode-java-pack/0.4.0/vspackage






share|improve this answer
























  • I already installed the java extension pack. and Java Maven is in the expansion pack, so I already installed it but I don't really know how to use Maven.

    – Moritz
    Nov 25 '18 at 12:32











  • go to menu bar and select debug menu and click start without debugging.

    – Atul Kumar
    Nov 25 '18 at 16:25











  • I'm getting the same error. Besides that, I want to use the debug features of VSC.

    – Moritz
    Nov 25 '18 at 20:51
















0














you should install a extension called "java extension pack" and java maven. or install that offline extension.click here and get extension name



Extension URL : https://marketplace.visualstudio.com/_apis/public/gallery/publishers/vscjava/vsextensions/vscode-java-pack/0.4.0/vspackage






share|improve this answer
























  • I already installed the java extension pack. and Java Maven is in the expansion pack, so I already installed it but I don't really know how to use Maven.

    – Moritz
    Nov 25 '18 at 12:32











  • go to menu bar and select debug menu and click start without debugging.

    – Atul Kumar
    Nov 25 '18 at 16:25











  • I'm getting the same error. Besides that, I want to use the debug features of VSC.

    – Moritz
    Nov 25 '18 at 20:51














0












0








0







you should install a extension called "java extension pack" and java maven. or install that offline extension.click here and get extension name



Extension URL : https://marketplace.visualstudio.com/_apis/public/gallery/publishers/vscjava/vsextensions/vscode-java-pack/0.4.0/vspackage






share|improve this answer













you should install a extension called "java extension pack" and java maven. or install that offline extension.click here and get extension name



Extension URL : https://marketplace.visualstudio.com/_apis/public/gallery/publishers/vscjava/vsextensions/vscode-java-pack/0.4.0/vspackage







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 25 '18 at 12:02









Atul KumarAtul Kumar

215




215













  • I already installed the java extension pack. and Java Maven is in the expansion pack, so I already installed it but I don't really know how to use Maven.

    – Moritz
    Nov 25 '18 at 12:32











  • go to menu bar and select debug menu and click start without debugging.

    – Atul Kumar
    Nov 25 '18 at 16:25











  • I'm getting the same error. Besides that, I want to use the debug features of VSC.

    – Moritz
    Nov 25 '18 at 20:51



















  • I already installed the java extension pack. and Java Maven is in the expansion pack, so I already installed it but I don't really know how to use Maven.

    – Moritz
    Nov 25 '18 at 12:32











  • go to menu bar and select debug menu and click start without debugging.

    – Atul Kumar
    Nov 25 '18 at 16:25











  • I'm getting the same error. Besides that, I want to use the debug features of VSC.

    – Moritz
    Nov 25 '18 at 20:51

















I already installed the java extension pack. and Java Maven is in the expansion pack, so I already installed it but I don't really know how to use Maven.

– Moritz
Nov 25 '18 at 12:32





I already installed the java extension pack. and Java Maven is in the expansion pack, so I already installed it but I don't really know how to use Maven.

– Moritz
Nov 25 '18 at 12:32













go to menu bar and select debug menu and click start without debugging.

– Atul Kumar
Nov 25 '18 at 16:25





go to menu bar and select debug menu and click start without debugging.

– Atul Kumar
Nov 25 '18 at 16:25













I'm getting the same error. Besides that, I want to use the debug features of VSC.

– Moritz
Nov 25 '18 at 20:51





I'm getting the same error. Besides that, I want to use the debug features of VSC.

– Moritz
Nov 25 '18 at 20:51


















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%2f53467054%2fvisual-studio-code-import-library%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

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

Calculate evaluation metrics using cross_val_predict sklearn

Insert data from modal to MySQL (multiple modal on website)