为什么我在Java中获得NoClassDefFoundError? [英] Why am I getting a NoClassDefFoundError in Java?

查看:125
本文介绍了为什么我在Java中获得NoClassDefFoundError?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行Java应用程序时,我得到 NoClassDefFoundError 。通常导致这种情况的原因是什么?

I am getting a NoClassDefFoundError when I run my Java application. What is typically the cause of this?

推荐答案

这是因为当您的代码依赖于类文件并且它是在编译时出现但在运行时找不到。查找构建时间和运行时类路径的差异。

This is caused when there is a class file that your code depends on and it is present at compile time but not found at runtime. Look for differences in your build time and runtime classpaths.

这篇关于为什么我在Java中获得NoClassDefFoundError?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆