使用IDEA时遇到问题:Exception in thread "main" java.lang.ClassNotFoundException:
2017-04-06 00:00
696 查看
摘要: 好多年没遇到这种问题了
Exception in thread "main" java.lang.ClassNotFoundException:
表示懵逼!!!!
首先代码如下:
报错误如下:
解决方案如下:
相关知识链接如下:
Exception in thread "main" java.lang.ClassNotFoundException:
表示懵逼!!!!
首先代码如下:
package com.tee.effct.code.example.clone; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; /** * Created by tll on 2017/4/6. */ public class CloneExample3 { public static void main(String[] args) { Map<String, String> map1 = new HashMap<>(); map1.put("x", "y"); map1.put("a", "b"); map1.put("c", "d"); map1.put("e", "d"); map1.put("f", "b"); map1.put("m", "n"); Map<String, ArrayList<String>> map2 = new HashMap<>(); String entryValue = null; String entryKay = null; ArrayList<String> tmpValue = new ArrayList<>(); ArrayList<String> tmpMap2Value = new ArrayList<>(); for (Map.Entry<String, String> entry : map1.entrySet()) { tmpValue.clear(); tmpMap2Value.clear(); entryKay = entry.getKey(); entryValue = entry.getValue(); if (map2.keySet().contains(entryValue)) { tmpMap2Value = map2.get(entryValue); tmpMap2Value.add(entryKay); map2.put(entryValue, (ArrayList<String>) tmpMap2Value.clone()); } else { tmpValue.add(entryKay); map2.put(entryValue, (ArrayList<String>) tmpValue.clone()); } } System.out.println(map2); } }
报错误如下:
"C:\Program Files\Java\jdk1.8.0_66\bin\java" -Didea.launcher.port=7533 "-Didea.launcher.bin.path=D:\IntelliJ IDEA 2016.1.3\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_66\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_66\jre\lib\rt.jar;D:\studyCode\effective;D:\IntelliJ IDEA 2016.1.3\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain com.tee.effct.code.example.clone.CloneExample3 Exception in thread "main" java.lang.ClassNotFoundException: com.tee.effct.code.example.clone.CloneExample3 at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:122) Process finished with exit code 1
解决方案如下:
相关知识链接如下:
相关文章推荐
- IDEA 14.1.3-import之前的scala项目报错:Exception in thread "main" java.lang.ClassNotFoundException: kmust.hj
- IDEA 14.1.3-import之前的scala项目报错:Exception in thread "main" java.lang.ClassNotFoundException: kmust.hj
- intelij 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
- 1. spring boot项目创建过程中遇到的问题(一):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.ClassNotFoundException: com.mysql.jdbc.Driver
- Exception in thread "main" java.lang.ClassNotFoundException: 解决方法
- 异常:Exception in thread "main" java.lang.ClassNotFoundException: Student
- Exception in thread "main" java.lang.ClassNotFoundException
- Exception in thread "main" java.lang.ClassNotFoundException: xxxx
- JDK版本问题Exception in thread "main" java.lang.UnsupportedClassVersionError: Hello
- JDK版本问题Exception in thread "main" java.lang.UnsupportedClassVersionError:
- Android使用Eclipse遇到"java.lang.ClassNotFoundException"
- Drools 运行时出现Exception in thread "main" java.lang.RuntimeException: wrong class format 的问题
- IDEA下使用JDBC连接数据库遇到java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
- HIVE Exception in thread "main" java.lang.IncompatibleClassChangeError: Found class jline.Terminal,
- Exception in thread "main" java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but i