0

I am working on a project in Java, and I would like to run unit tests on VSCode. Unfortunately the Java Test Runner extension isn't working (the Test Explorer is empty and I can't see the Code Lens) so I was advised I modify as the .classpath file (source: over here). And I can't find the file.

So what is the .classpath file? How do I find it? I am using MacOS.

John Mayne
  • 237
  • 1
  • 3
  • 14
  • The classpath is not a file -- it's an environment variable. You could (and should) have answered your own question with a quick web search, which would have turned up gems like [this](https://stackoverflow.com/questions/1675765/adding-to-the-classpath-on-osx) and [this](https://en.wikipedia.org/wiki/Classpath). Get in the habit of searching before posting new questions. Stack Overflow sets a high bar for research prior to posting. – MarsAtomic Jul 22 '20 at 15:06
  • The `.classpath` file is only available in VSCode if you have the required extensions and dependencies installed. You can see it referred to in [this guide](https://blog.usejournal.com/visual-studio-code-for-java-the-ultimate-guide-2019-8de7d2b59902) (there is a screenshot showing the location of the file). – andrewJames Jul 22 '20 at 15:34
  • Not certain if this warrants a full answer, so I'll drop a comment for now... If you run into this with the [Test Runner for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-test) VSCode extension, keep in mind that it's one of _six_ extensions included in the [Extension Pack for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack). I believe the file that John Mayne is looking for is created by the [Language Support for Java](https://marketplace.visualstudio.com/items?itemName=redhat.java) extension... – Andre Greeff Mar 04 '22 at 13:57

0 Answers0