Open Philippe-Laval opened 2 years ago
I managed to solve the problem : I added JavaExec in the project and/or changed JAVA_HOME to C:\Program Files\Java\jdk-18.0.2.1
<ItemGroup>
<Antlr4 Include="Modeler.g4">
<Package>Modeler</Package>
<JavaExec>c:/Program Files/Java/jdk-18.0.2.1/bin/java.exe</JavaExec>
</Antlr4>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Antlr4.Runtime.Standard" Version="4.10.1" />
<PackageReference Include="Antlr4BuildTasks" Version="10.7.0" />
</ItemGroup>
Long overdue, I'm setting up a bunch of tests to methodically go through all the possible permutations of java versions, JAVA_HOME, JAVA_EXEC, PATH, etc., and make sure each strange condition is handled with good information outputted. But, I do see that if you try to use an ancient java (jdk v7(), it crashes without any real information just as you encountered. Thanks for the info.
Added in a version check, will release in 11.0 of Antlr4BuildTasks. https://github.com/kaby76/Antlr4BuildTasks/commit/d212f0f74c9f3fe47570ceeda46f617ce618b54d
Thanks for adding more tests and a better error output. Effectively on my main computer I had SDK 11 and 17 installed. On the other computer SDK 8 or 9 => I had the problem. For my friend, which reported the error to me, he solved also the problem by installing JDK 18.
The nuget package antlr4buildtasks 10.7.0 has a warning icon in Visual Studio. I got this error message
C:\Users\philippe.laval.nuget\packages\antlr4buildtasks\10.7.0\build\Antlr4BuildTasks.targets(133,3): error ANT02: The Antlr4 tool failed.