Exception in thread "main" java.lang.NoClassDefFoundError: javax / xml / bind / DatatypeConverter

0

I'm doing an application on a computer, we're 4 and everyone uses Windows except me (Mac). This application uses a database with MySQL . At the beginning I had JDK 10 , now I have the 1.8 (8) . I have two versions of NetBeans , the 8.2 for Developers and the 9 Apache. It does not work with any of the two and with no JDK , the error it gives me is as follows:

>    Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter
>       at implementacion.Login.hash(Login.java:58)
>       at implementacion.Login.comprobacion(Login.java:34)
>       at interfaz.InterfazConsola.login(InterfazConsola.java:33)
>       at interfaz.InterfazConsola.run(InterfazConsola.java:23)
>       at xcapeapp.App.main(App.java:31)
>    Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter
>       at >java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
>       at >java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
>       at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
>       ... 5 more

The database works well, both the rest of the team in the application as well as my console, plus I've also handled it with MySQL WorkBench and everything is correct. The bug jumps me when doing Login , I think that it does not even want to correctly access the DB. It should be noted that we use GIT to be always updated and for the versions and that the application has a graphical interface programmed with java swing (although it is not possible to execute since the call to this in the main is commented).

    
asked by NSJ 13.11.2018 в 19:12
source

1 answer

0

The problem is that MS SQL JDBC driver 6.2 does not work with Java 10 since you have installed java 8 you should check your environment variables well and that everything is running with java 8 that's why it keeps giving you the problem .

As Microsoft pointed out in GitHub :

  

Currently none of our released drivers are compatible with JDK10.

    
answered by 13.11.2018 в 20:35