在dos中运行java程序,若出现Exception in thread “main" java.lang.NoClassDefFoundError,可以检查一下几项:

环境变量配置:

注意JAVA_HOME、classpath、path是否配置正确。

格式:

编译: javac HelloWorld.java

执行: java HelloWorld,不需要带扩展名“class”

同时注意大小写,Java是大小写敏感的

执行路径:

javac应该在工程的根目录下执行,若java文件在某个包中,需要加包名。如包名为hello,则在工程目录下使用java hello

在dos中运行java程序,若出现Exception in thread “main" java.lang.NoClassDefFoundError的更多相关文章

  1. 运行SparkStreaming程序时出现 Exception in thread "main" java.lang.NoSuchMethodError: scala.Predef$.ArrowA异常

    Exception in thread "main" java.lang.NoSuchMethodError: scala.Predef$.ArrowA 这个问题是版本不统一导致的 ...

  2. Java中调用c/c++语言出现Exception in thread "main" java.lang.UnsatisfiedLinkError: Test.testPrint(Ljava/lang/String;)V...错误

    错误: Exception in thread "main" java.lang.UnsatisfiedLinkError: Test.testPrint(Ljava/lang/S ...

  3. Java异常理解之Exception in thread “main“ java.lang.ArrayIndexOutOfBoundsException

    这个异常是Java中的数组越界问题 当你使用不合法的索引访问数组是会出现这种错误例如: class Solution { public static int climbStairs(int n) { ...

  4. java 错误之:Exception in thread "main" java.lang.NoClassDefFoundError

    Exception in thread "main" java.lang.NoClassDefFoundError: PointTest 环境变量的问题,把环境变量设置好了就可以了 ...

  5. java报错:Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE

    Exception in thread "main" java.lang.NoSuchFieldError: INSTANCE at org.apache.http.conn.ss ...

  6. wordcount在本地运行报错解决:Exception in thread "main" java.lang.UnsatisfiedLinkError:org.apache.hadoop.io.native.NativeID$Windows.access

    在windows中的intellij中运行wordcount程序,控制台输出以下报错 在Intellij编辑器中解决办法:本地重新创建NativeIO类,修改一个方法返回值,然后用新建的NativeI ...

  7. Linux运行Java出现“Exception in thread "main" java.lang.OutOfMemoryError: Java heap space”报错

    在运行如下程序时出现“Exception in thread "main" java.lang.OutOfMemoryError: Java heap space”报错: java ...

  8. GUI学习中错误Exception in thread "main" java.lang.NullPointerException

    运行时出现错误:Exception in thread "main" java.lang.NullPointerException 该问题多半是由于用到的某个对象只进行了声明,而没 ...

  9. exception in thread main java.lang.NoClassDefFoundError wrong name解决方法

    当不含包层次的HelloWorld.java代码(此时程序运行正常) public class HelloWorld{ public static void main(String[] args)   ...

  10. Exception in thread "main" java.nio.channels.NotYetConnectedException

    import java.nio.channels.AsynchronousServerSocketChannel; import java.nio.channels.AsynchronousSocke ...

随机推荐

  1. mysql处理字符串

    1.从左开始截取字符串 left(str, length) 说明:left(被截取字段,截取长度) 例:select left(content,200) as abstract from my_con ...

  2. python数据处理相关的一些知识点(学习点)

    自己总结了一下就是存储,消息处理(异步,阻塞,队列,消息中间件) 参考岗位需求 数据爬虫工程师的岗位职责:1.分布式网络爬虫研发:不断完善现有抓取系统,通过对抓取.解析.调度.存储等模块的拆分与优化, ...

  3. android设置多个类似APP其中的一个为默认

    05-09 17:01:13.547: I/ActivityManager(3003): START u0 {act=android.intent.action.VIEW cat=[android.i ...

  4. DataTime格式化大全(转载)

    //c datetime 格式化 DateTime dt = DateTime.Now; Label1.Text = dt.ToString();//2005-11-5 13:21:25 Label2 ...

  5. 必填项(required)

    当你设计表单时,你可以指定某些选项为必填项(required),只有当用户填写了该选项后,用户才能够提交表单. 例如,如果你想把一个文本输入字段设置为必填项,在你的input元素中加上required ...

  6. Java实验二20135104

    课程:Java程序设计          班级: 1351 姓名:刘帅                学号:20135104 成绩:             指导教师:娄嘉鹏       实验日期:2 ...

  7. springmvc之interceptor(拦截器)

    1.自定义MyInterceptor impletments HandlerInterceptor public class MyInterceptor implements HandlerInter ...

  8. OpenGL(四)——有用的函数

    概述 1. reshape 定义窗口和图像的映射关系,使在不以纵横比4:3调整窗口大小时,图像不会失真 函数 1. ReShape 如果变更后的窗体的横纵比大于4/3,需要以高为基数,宽为高*4/3, ...

  9. codeforces 425D

    题意:给定n<=100000个二维点,并且0<=x,y<=100000,求有多少个平行于坐标轴的正方形 思路:本来想hash的,但是感觉不好弄.. 后来感觉像是分块,最坏的情况就是那 ...

  10. 用c#开发微信 (8) 微渠道 - 推广渠道管理系统 3 UI设计及后台处理

    我们可以使用微信的“生成带参数二维码接口”和 “用户管理接口”,来实现生成能标识不同推广渠道的二维码,记录分配给不同推广渠道二维码被扫描的信息.这样就可以统计和分析不同推广渠道的推广效果. 前面二篇& ...