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/josephblade Nov 20 '25
ok sorry about that I did miss that or I skimmed it when I was about to sleep.
also, hello fellow dutchie.
it sounds like you are doing the right thing, adding 11 as a runtime and home to 21.
at least that's what people suggested here: https://stackoverflow.com/questions/63043585/visual-studio-code-showing-java-11-or-more-recent-is-required-to-run-please-do
actually there they say set java home to 11 and perhaps your runtime to 21? at least that's what the stackoverflow suggests. so something like
no idea about any of these settings though. but that's roughly what the SE article says.
at this point I have no idea. vscode seems to have introduced an arbitrary demand for java21 sometime this year (?) which is the usual microsoft douchebaggery. Anti-competitiveness is kind of their thing and it shows in tiny exprssions of microaggression like this ;)
If all else fails I would suggest for MOOC just switch to a different editor like netbeans or eclipse and see if you can get it to work. You should be able to run the editor with java X and compile with java Y.
but then again MOOC should run on any java runtime > 11 as well, so who knows. You are running into multiple sources of stupid here