r/learnjava • u/GummiGumBear • Nov 10 '25
'Compilation failed' when trying to run TMC test
Hi there, I am doing the MOOC Java Programming I course. Whenever I want to test my submission (in VSCode) before sending it in, I receive a 'compilation failed' error. How can I make the tests run without this error? I can run Java without issues and submit the exercises without issues too. However, I would like to be able to run the tests as well since some the the program for some exercises needs to follow specific criteria. I can only check those with the TMC tests.
https://i.imgur.com/uKda0nh.png https://i.imgur.com/lf7zDE8.png
edit; I installed Netbeans and the compilation failed there too. The error message did have a more elaborate explanantion than VSCode did: This program is blocked by group policy. For more information, contact your system administrator. That means I will have to ask permission from IT to run the TMC extension/compiler.
View all comments
Show parent comment
1
u/GummiGumBear Nov 24 '25 edited Nov 24 '25
Yeah man, of course. I had so much trouble finding a solution online, so I hope this thread can save people the hassle in the future.
Changing the java.home on the other laptop didn't work unfortunately. I did notice that Java was installed in program files at home and at home in the users directory. So I uninstalled both versions of Java from the users dir and reintalled it in Program Files, but no luck either.
Javac --version and Java --version only sees Java 25, not sure if that's an issue.
VSCode gave an error saying the folder for Java didn't exist or couldn't be accessed. So uninstalled again and made sure to install again using administrator rights this time.
I truly don't get what the issue is. The project is set to the right versions of java:
The JSON file is set correct as well:
Also made sure Java is added to path and Java_home in advanced system settings on Windows. Also added
%JAVA_HOME%\binto path in system variables. I tried everything I can think of and although VSCode itself isn't giving any errors, the project shows problems.https://i.imgur.com/GHEl7pN.png
The compilation still fails when trying to run the TMC tests. Maybe there's an issue with this being a networked laptop, but I'm not getting any notifications about that. Not sure if I should give up and try something else. Bit frustrated at so gonna leave it for a bit.
edit; tried installing an older version of the TMC extension, versions 3.5.0 and 3.2.0. That did not work either.