使用IDEA时遇到问题:Exception in thread "main" java.lang.ClassNotFoundException:
博客专区 > taole 的博客 > 博客详情
使用IDEA时遇到问题:Exception in thread "main" java.lang.ClassNotFoundException:
taole 发表于10个月前
使用IDEA时遇到问题:Exception in thread "main" java.lang.ClassNotFoundException:
  • 发表于 10个月前
  • 阅读 56
  • 收藏 0
  • 点赞 0
  • 评论 0

标题:腾讯云 新注册用户域名抢购1元起>>>   

摘要: 好多年没遇到这种问题了 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

解决方案如下:

 

 

 

 

 

相关知识链接如下:

 

共有 人打赏支持
粉丝 39
博文 46
码字总数 25827
×
taole
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: