First, off, as a general rule when debugging batch files always remove the echo off
line from the top of your batch. CMD is trying to tell you what the problem is and that first line is suppressing all debug information.
In this case, running without suppressing debug information shows you that your main
line is causing a syntax error.
echo public static void main(String[] args) {
{ was unexpected at this time.
The error is that certain characters are being interpreted as a special character in the batch file. The way to escape a character in batch is with the caret (^
). Adding them to all of the special characters in that line causes echo
to produce the correct output.
echo public static void main^(String^[^] args^) ^{
Not all of these escape characters are strictly necessary, but if you're unfamiliar with batch then it can be hard to tell which. The easiest and safest fix is to add an escape before any special character.
There are other syntax errors in your batch. You can continue running your batch with error messages enabled, and fix the remainder the same way.