如题,请问是不是我配置环境变量配置错了?

解决方案 »

  1.   

    在CMD里面说:Exception in thread "main"  java.lang.NoClassDefFoundError: C:\1000\Example2_1/class初学JAVA,所以看不懂```
      

  2.   

    main方法里面没有发现类,C:\1000\Example2_1/class
      

  3.   

    public class Example2_1
    {
        public static void main(String args[])
        {
    char chinaWord='你',japanWord=' ';
    int p1=20328,p2=12358;

    System.out.println("汉字\'你\'字在unicode表中的顺序位置:" + (intchinaWord);
    System.out.println("日语\' \'字在unicode表中的顺序位置:" + (int)japanWord);
    System.out.println("unicode表中第20328位置上的字符是:" + (char)p1);
    System.out.println("unicode表中第12358位置上的字符是:" + (char)p2);
    }
    }
      

  4.   

    可能你文件没有保存为Example2_1
    还有就是可能CLASS_PATH少了.;
      

  5.   

    System.out.println("汉字\'你\'字在unicode表中的顺序位置:" + (intchinaWord);
    少了个括号("汉字\'你\'字在unicode表中的顺序位置:" + (int)chinaWord);
      

  6.   

    System.out.println("汉字\'你\'字在unicode表中的顺序位置:" + (intchinaWord);
    ???可能是写错了只能说程序没有问题,看看CLASS_PATH
      

  7.   

    在classpath最前面加上.;
    就是一个点,一个分号.点代表当前路径.
    如果你没有classpath,那么会默认当前路径.
    如果你有classpath,就没有默认路径了.java虚拟机不会在当前目录下寻找你的class文件,只会在classpath中去找.所以说找不到class
      

  8.   

    这段代码我这里能运行啊!估计是你环境变量配错了,或者JVM有问题了,我以前也遇到过类似问题,重装一下jdk试试吧!应该不是大问题吧
      

  9.   

    System.out.println("汉字\'你\'字在unicode表中的顺序位置:" + (intchinaWord);1、缺少括号
    2、没有intchinaWord这个变量。
      

  10.   

    System.out.println("汉字\'你\'字在unicode表中的顺序位置:" + (intchinaWord);
    改为:
    System.out.println("汉字\'你\'字在unicode表中的顺序位置:" + (int)chinaWord);结果如下:
    汉字'你'字在unicode表中的顺序位置:20320
    日语' '字在unicode表中的顺序位置:32
    unicode表中第20328位置上的字符是:佨
    unicode表中第12358位置上的字符是:う你的问题肯定是环境变量的问题.
      

  11.   

    public class Example2_1{
        public static void main(String args[]){
    System.out.println("fsafsd");

    String japanWord="11";
    int p1=20328,p2=12358;
    System.out.println(Integer.parseInt(japanWord));
    System.out.println("unicode表中第20328位置上的字符是:" + (char)p1);
    System.out.println("unicode表中第12358位置上的字符是:" + (char)p2);
    }
    }
    你如果要转japanWord而且如果是字符的类弄就要赋值不然他转的时候不知道是啥类型的这样就会报错