在执行程序的时候,经常会在控制台顶部出现如下错误:
objc[20327]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java (0x10fc284c0) and /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x10fcfe4e0). One of the two will be used. Which one is undefined.
或者
objc[19990]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/bin/java (0x1060b54c0) and /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/jre/lib/libinstrument.dylib (0x1061e04e0). One of the two will be used. Which one is undefined.
虽然不影响程序的运行,但是强迫症犯了,必须解决,Google了一下,发现stactoverflower上面已经有解决方案:
附上链接:objc3648-class-javalaunchhelper-is-implemented-in-both
在idea中,点击Help –> Edit Custom Properties,打开编辑配置文件,如果从来没编辑过则提示文件不存在,是否创建,点创建就好了。
然后在对话窗口中输入:
#http://stackoverflow.com/questions/43003012/objc3648-class-javalaunchhelper-is-implemented-in-both idea.no.launcher=true
然后关闭IDEA,重新打开,再次运行后依旧发现还有这个错误。接着往下看发现如下回答:
I am using Intellij Idea 2017 and I got into the same problem. What solved the problem for me was to simply close the project in intelliJ File -> New -> project from existing resources use Import from external model (if any) open the project again.
那么只需要重新导入一下项目即可。