Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request to add support for .properties files in Java Referenced Libraries #537

Closed
jonathanbarnett opened this issue Aug 16, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@jonathanbarnett
Copy link

#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:

	<classpathentry kind="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.

@jdneo jdneo added the enhancement New feature or request label Aug 17, 2021
@fbricon
Copy link

fbricon commented Aug 18, 2021

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?

@jonathanbarnett
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants