Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with Visual Studio 17.3.1 #41

Open
Philippe-Laval opened this issue Aug 24, 2022 · 4 comments
Open

Error with Visual Studio 17.3.1 #41

Philippe-Laval opened this issue Aug 24, 2022 · 4 comments

Comments

@Philippe-Laval
Copy link

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.

@Philippe-Laval
Copy link
Author

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>

@kaby76
Copy link
Owner

kaby76 commented Aug 24, 2022

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.

@kaby76
Copy link
Owner

kaby76 commented Aug 24, 2022

Added in a version check, will release in 11.0 of Antlr4BuildTasks. d212f0f

@Philippe-Laval
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants