没有引入jar包

没有引入jar包

老师,我的External Libraries里面只有一个jdk 的并没有依赖的JUnit的包。代码和老师的一样。

正在回答

登陆购买课程后可参与讨论,去登陆

8回答

同学你好。可能是IDEA没有配置好本地的maven,同学可以参考本节教辅 IDEA使用maven常见问题汇总.pdf 中的 1、2、5 给出的方案,分别配置一下本地的maven仓库、给本地仓库加上国内镜像。解决下载问题。

另外,同学的maven版本是否是3.6.2?IDEA 2019版对maven 3.6.2 的支持不够友好。有时会出现问题,建议将maven换为3.6.0版本。

如果解答了同学的疑问,望采纳

祝学习愉快~

提问者 98DONG 2019-12-07 19:33:58
  • 提问者 98DONG #1
    打开idea就有这个提示
    2019-12-07 19:39:04
好帮手慕阿满 2019-12-07 18:26:58

同学你好,同学截取的日志信息可能是IDEA运行的报错。问一下同学删除本地仓库中的Junit后,在pom文件中重新引入对应依赖,External Libraries是否有Junit的jar包呢?如果没有,建议同学在IDEA右边,找到MAVEN,执行clean,install再试试,如:

http://img1.sycdn.imooc.com//climg/5deb7e61094cdd8702500223.jpg

祝:学习愉快~

提问者 98DONG 2019-12-07 16:25:27

老师,这个是我在idea日志中找到的,报了错误,和这个有关系吗?

---------------------------------------------------------------

2 errors

at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:543)

at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:159)

at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:106)

at com.google.inject.Guice.createInjector(Guice.java:87)

at com.google.inject.Guice.createInjector(Guice.java:69)

at com.google.inject.Guice.createInjector(Guice.java:59)

at org.codehaus.plexus.DefaultPlexusContainer.addComponent(DefaultPlexusContainer.java:344)

at org.codehaus.plexus.DefaultPlexusContainer.addComponent(DefaultPlexusContainer.java:332)

at org.jetbrains.idea.maven.server.Maven3ServerEmbedderImpl.customizeComponents(Maven3ServerEmbedderImpl.java:556)

at org.jetbrains.idea.maven.server.Maven3ServerEmbedderImpl.customize(Maven3ServerEmbedderImpl.java:526)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)

at sun.rmi.transport.Transport$1.run(Transport.java:200)

at sun.rmi.transport.Transport$1.run(Transport.java:197)

at java.security.AccessController.doPrivileged(Native Method)

at sun.rmi.transport.Transport.serviceCall(Transport.java:196)

at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)

at java.security.AccessController.doPrivileged(Native Method)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:283)

at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:260)

at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:161)

at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)

at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)

at com.sun.proxy.$Proxy135.customize(Unknown Source)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at com.intellij.execution.rmi.RemoteUtil.invokeRemote(RemoteUtil.java:175)

at com.intellij.execution.rmi.RemoteUtil.access$200(RemoteUtil.java:38)

at com.intellij.execution.rmi.RemoteUtil$1$1$1.compute(RemoteUtil.java:156)

at com.intellij.openapi.util.ClassLoaderUtil.runWithClassLoader(ClassLoaderUtil.java:66)

at com.intellij.execution.rmi.RemoteUtil.executeWithClassLoader(RemoteUtil.java:227)

at com.intellij.execution.rmi.RemoteUtil$1$1.invoke(RemoteUtil.java:153)

at com.sun.proxy.$Proxy135.customize(Unknown Source)

at org.jetbrains.idea.maven.server.MavenEmbedderWrapper.doCustomize(MavenEmbedderWrapper.java:96)

at org.jetbrains.idea.maven.server.MavenEmbedderWrapper.lambda$customizeForResolve$1(MavenEmbedderWrapper.java:69)

at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:76)

at org.jetbrains.idea.maven.server.MavenEmbedderWrapper.customizeForResolve(MavenEmbedderWrapper.java:68)

at org.jetbrains.idea.maven.project.MavenProjectsTree.resolve(MavenProjectsTree.java:1272)

at org.jetbrains.idea.maven.project.MavenProjectsProcessorResolvingTask.perform(MavenProjectsProcessorResolvingTask.java:45)

at org.jetbrains.idea.maven.project.MavenProjectsProcessor.doProcessPendingTasks(MavenProjectsProcessor.java:135)

at org.jetbrains.idea.maven.project.MavenProjectsProcessor.access$000(MavenProjectsProcessor.java:32)

at org.jetbrains.idea.maven.project.MavenProjectsProcessor$2.run(MavenProjectsProcessor.java:109)

at org.jetbrains.idea.maven.utils.MavenUtil.lambda$runInBackground$5(MavenUtil.java:458)

at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:311)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

2019-12-07 16:04:00,623 [ 579457]  ERROR -      #org.jetbrains.idea.maven - IntelliJ IDEA 2019.1.3  Build #IU-191.7479.19 

2019-12-07 16:04:00,623 [ 579457]  ERROR -      #org.jetbrains.idea.maven - JDK: 1.8.0_202-release; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o 

2019-12-07 16:04:00,623 [ 579457]  ERROR -      #org.jetbrains.idea.maven - OS: Windows 10 

2019-12-07 16:04:00,639 [ 579473]  ERROR -      #org.jetbrains.idea.maven - Last Action: EditorChooseLookupItem 

2019-12-07 16:04:02,734 [ 581568]   INFO - rationStore.ComponentStoreImpl - Saving appFileTypeManager took 16 ms 

2019-12-07 16:04:02,750 [ 581584]   INFO - rationStore.ComponentStoreImpl - Saving Project 'C:\Users\11\IdeaProjects\ideamaven' ideamavenMavenImportPreferences took 16 ms 

2019-12-07 16:04:02,781 [ 581615]   INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 94 ms 

2019-12-07 16:04:06,421 [ 585255]   INFO - rationStore.ComponentStoreImpl - Saving appHttpConfigurable took 16 ms 

2019-12-07 16:04:06,436 [ 585270]   INFO - rationStore.ComponentStoreImpl - Saving Project 'C:\Users\11\IdeaProjects\ideamaven' ideamavenShelveChangesManager took 15 ms 

2019-12-07 16:04:06,514 [ 585348]   INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 140 ms 

2019-12-07 16:04:26,781 [ 605615]   INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 49 ms 

2019-12-07 16:04:36,372 [ 615206]   INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 140 ms 

2019-12-07 16:06:40,673 [ 739507]   INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 47 ms 

2019-12-07 16:07:55,367 [ 814201]   WARN - gin.utils.ProfilingUtilAdapter - YourKit controller initialization failed : To profile application, you should run it with the profiler agent 

2019-12-07 16:08:01,774 [ 820608]   INFO - ide.actions.ShowFilePathAction - 

Exit code 1 

2019-12-07 16:08:02,274 [ 821108]   INFO - rationStore.ComponentStoreImpl - Saving appFileTypeManager took 15 ms 

2019-12-07 16:08:02,274 [ 821108]   INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 47 ms 


好帮手慕阿满 2019-12-07 15:44:45

同学你好,这个可能是下载时没有下载完整造成,建议同学查看本地仓库中Junit的目录,删除其中的内容,重新引入Junit依赖保存pom文件再试试。

祝:学习愉快~

提问者 98DONG 2019-12-07 10:38:45
好帮手慕阿满 2019-12-06 18:27:58

同学你好,建议同学点击右下角的logs,查看具体报错

http://img1.sycdn.imooc.com//climg/5dea2d190939b48902250072.jpg

祝:学习愉快~

  • 提问者 98DONG #1
    老师,帮我看一下呀,截图发上来了。
    2019-12-07 13:28:43
好帮手慕阿满 2019-12-06 17:17:19

同学你好,建议同学查看一下IDEA右下角是否有如下内容,如果有,建议同学点击Enable Auto-Import,如:

http://img1.sycdn.imooc.com//climg/5dea1c4309e2260305670105.jpg

如果没有,可能是下载时没有下载完整造成,建议同学查看本地仓库中JUint的目录,删除其中的内容,重新保存pom文件再试试。

如果我的回答解决了你的疑惑,请采纳。祝:学习愉快~

  • 提问者 98DONG #1
    有那个,但是点完了,就提示 Unable to import maven project: See logs for details
    2019-12-06 17:25:59
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师