4

I am using Visual Studio Code with the java.home setting set to the directory of my JDK 11 installation. I have a Maven project and use 3.5.4 and have it added to my path, so I can run mvn in a console. Maven works as expected, as well as running the code's main method, however when I run a JUnit 4.12 test by clicking Run Test that is shown over an annotated @Test method, the test runs, however I am unable to view any console output from the JUnit tests.

Under Output, I have the Test Output window, which is where I would expect the console to output, however nothing shows up even though the test method runs System.out.println("test");

How would I go about making JUnit 4.12 display the test console output when a test is run by clicking the Run Test button shown over a test method?

2
  • I know this is old, but for people who land here, what version of VS Code? Sep 11, 2019 at 19:27
  • @chrisinmtown From my research, I believe this was VSCode 1.29, although there are reports of the issue on 1.27 and 1.28 as well.
    – Josh
    Nov 21, 2020 at 4:21

1 Answer 1

3

This is currently a known issue in the plugin. The workaround is to disable the Maven plugin. (You can still use the terminal within VS Code to run Maven)

2
  • Is this issue still present?
    – zygimantus
    Oct 16, 2020 at 16:08
  • @zygimantus If I remember correctly, the issue was no longer present a few months after this. I haven't used it in over a year now though, so it may have come back.
    – Josh
    Nov 21, 2020 at 4:18

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.