简体   繁体   English

使用Tomcat 7和Java 7的NIO的ClassNotFoundException

[英]ClassNotFoundException of NIO using Tomcat 7 and Java 7

I build a web project in Eclipse Kepler with Apache Tomcat 7.0.47. 我在Eclipse Kepler中使用Apache Tomcat 7.0.47构建了一个Web项目。

While running on server, it causes java.lang.ClassNotFoundException: java.nio.file.Paths as below. 在服务器上运行时,它将导致java.lang.ClassNotFoundException: java.nio.file.Paths如下。

java.lang.NoClassDefFoundError: java/nio/file/Paths
    at ...
Caused by: java.lang.ClassNotFoundException: java.nio.file.Paths
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
    ... 12 more

It worked well before I invite this new feature of Java 7. Could anyone give me some suggest to figure out what's going on here please? 在我邀请Java 7的新功能之前,它运行良好。请问有人可以给我一些建议来弄清楚这里发生了什么吗?

Uninstalling older version is not required. 不需要卸载旧版本。

But it is obvious that your Tomcat 7.0 still uses the jdk 6. There are two paths system path and user path. 但是很明显,您的Tomcat 7.0仍使用jdk6。系统路径和用户路径有两个路径。 Check both of them. 都检查一下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM