vscode-java-debug | Java Debugger for Visual Studio Code | Code Inspection library
kandi X-RAY | vscode-java-debug Summary
kandi X-RAY | vscode-java-debug Summary
A lightweight Java Debugger based on Java Debug Server which extends the Language Support for Java by Red Hat. It allows users to debug Java code using Visual Studio Code (VS Code). Here's a list of features:.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vscode-java-debug
vscode-java-debug Key Features
vscode-java-debug Examples and Code Snippets
Community Discussions
Trending Discussions on vscode-java-debug
QUESTION
import java.io.IOException;
import java.io.File;
import java.nio.file.Path;
import java.util.Scanner;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.NoSuchElementException;
public class filehandling{
public static void main(String[] args){
Scanner x = new Scanner(System.in);
while(true){
System.out.println("1. write 2. read 3. delete 4. create 5.exit");
System.out.print("Enter choice: ");
int ch = x.nextInt();
if(ch==1){
writer1 var0 = new writer1();
var0.function1();
}
if(ch==2){
reader1 var0 = new reader1();
var0.function2();
}
if(ch==3){
delete1 var0 = new delete1();
var0.function4();
}
if(ch==4){
create1 var0 = new create1();
var0.function3();
}
if(ch==5){
System.out.println("exited, thank you for using program");
x.close();
break;
}
}
}
}
class writer1{
void function1(){
Scanner y = new Scanner(System.in);
System.out.print("Input file name: ");
String path = y.nextLine();
File file = new File("D:\\"+path);
System.out.print("input number of lines: ");
Scanner a = new Scanner(System.in);
int n = a.nextInt();
Scanner z = new Scanner(System.in);
System.out.print("input data: ");
String data = z.nextLine();
FileWriter fr = null;
BufferedWriter br = null;
String datawithnewline = data+System.getProperty("line.separator");
System.out.println(datawithnewline);
try {
for(int i = n; i>0;i--){
try {
fr = new FileWriter(file);
br = new BufferedWriter(fr);
br.write(datawithnewline);
} catch (NoSuchElementException e) {
System.out.println("DONE ");
}
}
} catch (IOException e) {
System.out.print("error");
}
finally{
try{
br.close();
fr.close();
y.close();
z.close();
a.close();
}
catch(IOException e){
System.out.print("Error 2");
}
}
}
}
class reader1{
void function2(){
Scanner y = new Scanner(System.in);
System.out.print("Input file name: ");
String path = y.nextLine();
File file = new File("C:\\Users\\subra\\AppData\\Local\\Temp\\vscodesws_32946\\jdt_ws\\jdt.ls-java-project\\src"+path);
if(file.canRead()){
FileReader fr = null;
BufferedReader br = null;
try{
fr = new FileReader(path);
br = new BufferedReader(fr);
int var = 0;
while(( var=br.read())!= -1){
char text = (char) var;
System.out.print(text);
}
}
catch(IOException e){
System.out.println("Error");
}
finally{
y.close();
if (fr !=null){
try{
fr.close();
}
catch(IOException e){
System.out.println("Error");
}
}
if(br!=null){
try{
br.close();
}
catch(IOException e){
System.out.println("Error");
}
}
}
}
}
}
class create1{
public void function3(){
Scanner var1 = new Scanner(System.in);
System.out.print("Input file name: ");
String var2 = var1.nextLine();
File file = new File("D:\\"+var2);
try {
boolean createNewfile = file.createNewFile();
System.out.println("File created: "+createNewfile);
} catch (IOException e) {
System.out.println("Error");
var1.close();
}
}
}
class delete1{
public void function4(){
Scanner y = new Scanner(System.in);
System.out.print("Input file name");
String path = y.nextLine();
Path path1 = Path.of(path);
String path2 = path1.toString();
File file = new File(path2);
if(file.canRead()){
boolean delete = file.delete();
System.out.println("DELETED FILE: "+delete);
}
y.close();
}
}
...ANSWER
Answered 2021-Oct-17 at 14:02You only should be using one Scanner across all your classes, and only closing it once
Using an example from only one of your classes (classes should be capitalized, and generally don't use numbers)
QUESTION
I was using WSL while learning programming in Python at the university, but have Java installed in the Windows filesystem. Now that we switched to learning Java, VScode is trying to debug from the WSL terminal, which does not work. How can I tell VScode to run the debug on the Command Prompt? I guess something path related but I am a bit lost.
I get the following error message:
...ANSWER
Answered 2021-Sep-01 at 02:10Open integrated Terminal and click the selection box, choose Select Default Profile
, in the popping up list box, choose Command Prompt, then press Ctrl+Shift+` to open a new integrated Terminal, it's cmd.
Debugging .java
file is also executed in CMD window in terminal. See the following gif:
QUESTION
I am new to Springboot and I am trying to create a simple example Account entity class.
Ma20099449BankApplication.java class
...ANSWER
Answered 2021-Aug-01 at 13:47It seems that your Application.propertiesfile has a wrong key value, change this line: spring.jpa.hibernate.ddl-auto=update #it will automatically create tables for all declared entities
for it:
spring.jpa.hibernate.ddl-auto=update
#it will automatically create tables for all declared entities
try to not comment in front of the value, I think it can be the problem because your error log:
Caused by: java.lang.IllegalArgumentException: Unrecognized legacy hibernate.hbm2ddl.auto
value : update #it will automatically create tables for all declared entities
QUESTION
I tried to fix the error but it always returns this Exception,and when trying to handle and exception still goes wrong
Terminal Exception
...ANSWER
Answered 2021-Jun-08 at 08:59When you do findAll().stream()
the method "findAll" needs to complete non-exceptionally.
There are no code paths that return a List?
Instead of throw new RuntimeException(...);
use
QUESTION
Visual Studio Code doesn't resolve dependencies declared in my build.gradle.kts
file in this test project. Can you help me see what I'm doing wrong?
I'm using the newest VScode (downloaded 1.52.1 yesterday), and I've started from a clean install by deleting %APPDATA%\Code
and %USERPROFILE%\.vscode
before starting VScode.
When opening up my Java file and installing various suggested extensions (see below), I end up seeing The import org.keycloak cannot be resolved
:
which is true for any dependencies from build.gradle.kts
. Notice how java.util.List
is fine.
gradle
builds the project fine, even from within VScode:
Also, "Java Projects" shows "Referenced Libraries" as empty:
I suspect that an empty "Referenced Libraries" is related to not resolving org.keycloak
above.
The exact same project is fine when opened in Intellij.
I've used this test project, and after installing various suggested extensions, I ended up with this list from code --list-extensions
:
ANSWER
Answered 2021-Jan-25 at 00:50Gradle *.kts files are not supported right now, which means your project is not recognized correctly.
See: https://github.com/redhat-developer/vscode-java/issues/632
QUESTION
Hope you're doing well. I'm creating this simple app where you write text into a TextField and it should write it within a new JSON File in the resources folder. I'm pretty sure that my code is perfectly fine upon checking it with my professors, however, upon importing the library as seen here:
And executing the following code when the button is pushed:
*I have the following imports at the top of my JFRame class (The IDE shows no errors under those lines) :
...ANSWER
Answered 2021-Apr-23 at 07:26I download gson-2.8.6.jar from Maven Repository, after adding it to referenced libraries, the code works well:
Please check if your jar misses some parts. Open command palette and choose Java: Clean Java Language Server Workspace then redownload the jar and see if question goes away.
QUESTION
I am a beginner with java and programmin over all, So this the full code for a file reader program that counts words or displays text file content, I wanted to take user inputs for commands that I indicated using an if statement, but String printFileCommand = scan.nextLine();
is not working due to the error addressed below:
ANSWER
Answered 2021-Feb-01 at 22:36Please check this question: NoSuchElementException - class Scanner
Your code will work if you remove the code:
QUESTION
I have just started to use Java in VScode and when i run the code i see a path in blue color which i dont want to see.
...ANSWER
Answered 2020-Dec-15 at 14:01You must add the bin folder under the folder where you installed Java (for example C: \ Program Files \ Java \ jdk1.6.0_17 \ bin) to the Path variable of your system.
QUESTION
I'm trying to make Java programs work on Visual Studio Code. I've downloaded the Microsoft extension, downloaded the JKE from Oracle, and now I'm trying to run the proverbial "Hello World" Java program to make sure it works. Here is my program (I got it from the "Get Started" tutorial so it should be fine):
...ANSWER
Answered 2020-Dec-07 at 17:34The answer to this problem is to double check, nay, triple check your file names. The problem is that with Visual Studio Code's way of running programs (that is hitting the run button), any '
can cause serious problems. This is due to the fact that VS Code uses '
to quote file paths. Thanks to Eliott Frisch for pointing this out to me.
There are two possible solutions to this:
Change your folder name to remove the problematic character. In my case, however, my folder was running programs so I couldn't do that. This leads me to...
Create a new folder and move your programs there. This is, in my opinion, the best solution since you generally want a separate folder for your programs anyway.
Note that this is especially important for Java programs, since in Visual Studio Code you can't run Java programs with java name.java
. Similarly, this is not important for Python programs, since those can be run with python name.py
and therefore don't require any file names.
QUESTION
I'm not really sure what terminology I should use for this, but for example, to run a Java application on vscode, I can press ctrl + F5 and the terminal will print out
...ANSWER
Answered 2020-May-07 at 09:18no, you cann't, because the terminal cann't get the value which you had defined, and the debug extension will dynamically change the port of the server, so, even you copy the commands you had used, it willn't work any more, you can try it. so, let the extension do the things what is belongs to it.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vscode-java-debug
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page