Gradle ClassNotFound ElementTraversal

  gradle, java, windows

I did an install of Gradle using these instruction for Windows. I used the bin version (instead of the full source).

NOTE: the bin version has a slightly different path when the file is unzipped but I accounted for that when I was doing my setup.

The first thing I did after I completed the instructions was gradle -v to verify the install and version. I got this error:

org.gradle.internal.UncheckedException: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
        at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:67)
        at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:41)
        at org.gradle.internal.classloader.ClasspathUtil.getClasspathForClass(ClasspathUtil.java:89)
        at org.gradle.internal.classloader.DefaultClassLoaderFactory.createIsolatedClassLoader(DefaultClassLoaderFactory.java:61)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:50)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:31)
Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at org.gradle.internal.classloader.ClasspathUtil.getClasspathForClass(ClasspathUtil.java:82)
        ... 4 more

This is very strange to me since I am not actually doing anything besides checking the version.

How can I fix this?

Source: Windows Questions

LEAVE A COMMENT