'ANT 1.8.2 fresh install NoClassDefFoundError

I'm trying to configure ant 1.8.2 on my windows 10 machine and I'm getting the following error:

java.lang.NoClassDefFoundError
        at org.apache.tools.ant.launch.Locator.class$(Locator.java:134)
        at org.apache.tools.ant.launch.Locator.getResourceSource(Locator.java:134)
        at org.apache.tools.ant.launch.Locator.getClassSource(Locator.java:118)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:175)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.ClassNotFoundException: org/apache/tools/ant/launch/Locator
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:195)
        ... 5 more

Environment variables are configured as expected:

JAVA_HOME = C:\Program Files\Java\jdk1.7.0_80

ANT_HOME = C:\apache-ant-1.8.2

Both variables are included on PATH with \bin.

The ant command throws the exception as well as running ANT with the absolute path.

I have already unzipped it several times but honestly I'm running out of ideas.

Problem resolved: After a lot of struggle the problem was actually inside the JDK. Reinstalling it as administrator resolved the issue.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source