I was trying to build a gradle project but it returned with an error: I’m using vscode for this I saw some questions similar to this but they were about android studio, and I couldn’t find anything else about it. Thanks for any help. Answer the issue has been resolved on github: https://github.com…
Tag: visual-studio-code
Visual Studio Code puts .class files in src folder when compiling
When I compile and run my project, Visual Studio Code automatically generates a .class file for each .java file and puts them in the src folder, but they are already stored in the bin folder. Why are they duplicated? Answer If you compile .java file manually by command javac name.java, the .class file will be…
how to set JDK in UBUNTU-20.04 using VSCODE?
I am having problem with vscode and jdk, I use it in windows with many configs, but with ubuntu, It brings me this error: Everything is ok with jdk-default on vscode bash terminal. jdk bin: jdk version: but, if I try to found a $JAVA_HOME on terminal, it returns empty.. I do not know more what can I do……
VSCode Maven “X.java is not on the classpath of project Y”
Currently I have an issue with Maven is Visual Studio Code where it reports errors related to the classpath. The project structure is as following: And the pom.xml of project has: This POM only serves as ‘dummy’ in order to compile each sub project And in the pom.xml of each subproject has the fol…
Vs code terminal issue
When I tried to run java code in visual studio code, the terminal is throwing an error PowerShell terminated with exit code:4294901760 I have searched all queries but nothing is relatable. Answer You need to install java in VS-Code. To do so you can just search “java” in the extensions search bar.…
VSCode Java Debugger throwing unknown error
I had to re-install VSCode on my machine after an issue I was having, and after having done so, I can no longer run my Spring application. There is no error code, thrown, I can’t find it in the VSCode logs, and the dialog isn’t even copyable. This is the error dialog displayed: The launch.json con…
How to pass gradle.properties key/value pairs into JUnit test when clicking VSCode “Run Test” codelens
We set several key/value pairs in our gradle.properties file. (eg LOGIN_UID, LOGIN_PWD) We can successfully reference them in our build.gradle (eg $LOGIN_UID) and our JUnit tests (eg System.getProperty(“LOGIN_UID”) when running gradle test from the cmdline. However when clicking on a Run Test code…
VSCode Redhat language support for Java’s formatter forces max line length
I’m using VS Code IDE for Java project. I install Language Support for Java(TM) by Red Hat for formating code. settings.json: I’m writing a class like that: When i format code (Press Ctrl + s), it becomes: At the constructor, it seems like the formator was trying to fill every parameters into one …
How to show Javadoc of a imported library when hovering on its methods and classes?
As described in the title. We were currently using JSFML and Swing to develop a project, where I would like to view the Javadoc of JSFML in VSCode. However, when I tried to hover to show Javadoc it doesn’t but throws me only a simple line. For example: I built a renderWindow by using one of JSFML’…
Add tests to java classpath vscode
This is my current setup: I want to be able to run the tests, but VSCode doesn’t detect them: I have tried creating the following .classpath, but still doesn’t work: I can run the test in the terminal using: Answer Update: There is another more convenient approach: You can configure the classpath …