You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#213 added support for managing the JARs referenced by a Java project by setting a value for java.project.referencedLibraries in VSCode. However, it doesn't seem to be possible to specify other types of files here (e.g. Java properties files). This is an issue for me, as my project comes with a file called local/testconfig.properties that we load on the classpath with the following line in the .classpath file:
<classpathentrykind="lib"path="local"/>
This works fine when running my code from the command line, however because VSCode does not support loading files like this, it means that all of my Junit tests fail if I try to run them directly within VSCode. Previously, I used Eclipse for Java development, and Eclipse does support specifying a directory on the classpath.
According to a post by @jdneo in microsoft/vscode-java-pack#94 (comment) this seems like a known limitation, so I wanted to register the fact that adding support for loading .properties files would be a major improvement from my perspective.
The text was updated successfully, but these errors were encountered:
java.project.referencedLibraries is used by projects that are neither Maven/Gradle nor Eclipse projects. i.e. for a simple folder containing java files.
If your project is a simple Eclipse project, your classpath entry should just work. Can you provide a complete example project so we can reproduce the problem?
Ah. I think this is a case of me being a muppet. I'd initially added in the java.project.referencedLibraries entry to settings.json to get round an issue where tools.jar wasn't being found in $JAVA_HOME/lib. I hadn't realised that specifying a value here overrides the logic that reads the .classpath file, though I can now see that that makes sense. I've resolved the underlying issue with tools.jar, deleted the java.project.referencedLibraries entry and can now see that VSCode is correctly reading everything from my .classpath file. Closing this issue.
#213 added support for managing the JARs referenced by a Java project by setting a value for
java.project.referencedLibraries
in VSCode. However, it doesn't seem to be possible to specify other types of files here (e.g. Java properties files). This is an issue for me, as my project comes with a file calledlocal/testconfig.properties
that we load on the classpath with the following line in the .classpath file:This works fine when running my code from the command line, however because VSCode does not support loading files like this, it means that all of my Junit tests fail if I try to run them directly within VSCode. Previously, I used Eclipse for Java development, and Eclipse does support specifying a directory on the classpath.
According to a post by @jdneo in microsoft/vscode-java-pack#94 (comment) this seems like a known limitation, so I wanted to register the fact that adding support for loading .properties files would be a major improvement from my perspective.
The text was updated successfully, but these errors were encountered: