Visual Studio Code import Library
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
add a comment |
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
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
add a comment |
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
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
java visual-studio-code
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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
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
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%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
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
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%2f53467054%2fvisual-studio-code-import-library%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
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