intelij idea: Exception in thread "main" java.lang.ClassNotFoundException
2016-12-18 22:24
666 查看
http://www.cnblogs.com/do-better/p/5864165.html
从网上搜了好多,大多是说,在类里边是不是没有main函数,而且强调了main函数的写法: public static void main(String[] args)
还有人说了classpath的问题,是不是找不到那个类,等等。
其实,我使用的是intelij idea,也看了书,知道main该怎么写,所以,以上答案都不对!
直到我看到了顶上的答案,实验了一下,果然如此!!我已经找了一周的方法了,查了那么多网页,就这个是对的!我要把这个小错误再记录一下,希望能被其他新手看到,少耽误时间!
对,就是project structure对话框,module的设置里,paths那一项,把输出的位置设置好,估计关键是那个文件夹要存在吧?我为了统一管理输出,在project设置里,project compiler output下设置了一个绝对路径的文件夹,已经存在的文件夹,然后再module的设置的paths里,输出那一项,选择继承,即inherit project compile output path。
从网上搜了好多,大多是说,在类里边是不是没有main函数,而且强调了main函数的写法: public static void main(String[] args)
还有人说了classpath的问题,是不是找不到那个类,等等。
其实,我使用的是intelij idea,也看了书,知道main该怎么写,所以,以上答案都不对!
直到我看到了顶上的答案,实验了一下,果然如此!!我已经找了一周的方法了,查了那么多网页,就这个是对的!我要把这个小错误再记录一下,希望能被其他新手看到,少耽误时间!
对,就是project structure对话框,module的设置里,paths那一项,把输出的位置设置好,估计关键是那个文件夹要存在吧?我为了统一管理输出,在project设置里,project compiler output下设置了一个绝对路径的文件夹,已经存在的文件夹,然后再module的设置的paths里,输出那一项,选择继承,即inherit project compile output path。
相关文章推荐
- IDEA 14.1.3-import之前的scala项目报错:Exception in thread "main" java.lang.ClassNotFoundException: kmust.hj
- 使用IDEA时遇到问题:Exception in thread "main" java.lang.ClassNotFoundException:
- IntelliJ IDEA Exception in thread "main" java.lang.ClassNotFoundException
- idea找不到导入的包和类,intelij idea: Exception in thread "main" java.lang.ClassNotFoundException
- IDEA 14.1.3-import之前的scala项目报错:Exception in thread "main" java.lang.ClassNotFoundException: kmust.hj
- 异常:Exception in thread "main" java.lang.ClassNotFoundException: Student
- Exception in thread "main" java.lang.ClassNotFoundException
- Exception in thread "main" java.lang.ClassNotFoundException: 解决方法
- Exception in thread "main" java.lang.ClassNotFoundException: xxxx
- Exception in thread "main" java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
- IDEA java编译中出现了Exception in thread “main" java.lang.UnsupportedClassVersionError
- idea中使用scala运行spark出现Exception in thread "main" java.lang.NoClassDefFoundError: scala/collection/GenTraversableOnce$class
- idea中使用scala运行spark出现Exception in thread "main" java.lang.NoClassDefFoundError: scala/collection/GenTraversableOnce$class
- Exception in thread "main" java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop
- Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class org.fusesource
- Exception in thread "main" java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but i
- HIVE Exception in thread "main" java.lang.IncompatibleClassChangeError: Found class jline.Terminal,
- Exception in thread "main" java.lang.IncompatibleClassChangeError: Found class com.squareup.okhttp.C
- Exception in thread "main" java.lang.IncompatibleClassChangeError: Found interface com.mysql.jdbc.Co
- idea main" java.lang.ClassNotFoundException