How to set jdbc driver classpath

前端 未结 2 677
悲哀的现实
悲哀的现实 2021-01-26 02:36

When I copy mysql jdbc driver to JDK\'s\\jre\\lib\\ext, it execute perfectly well. Now, I want to use the jdbc by specifying its classpath to environment variable. But, after d

2条回答
  •  醉梦人生
    2021-01-26 03:16

    You should not be putting ANY JARs in the jre/lib/ext folder.

    You set the CLASSPATH using the -classpath option on javac.exe when you compile and java.exe when you run. Make sure that your code and all 3rd party JARs are in the CLASSPATH when you compile and run. Windows uses the semi-colon as the separator; Linux uses colon.

    Maybe you need to start here:

    http://docs.oracle.com/javase/tutorial/getStarted/cupojava/win32.html

提交回复
热议问题