java 在 intellij 中导入的 Spring Boot 项目不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/45146174/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Spring boot project imported in intellij not working
提问by scalp007
采纳答案by scalp007
My problem is fixed. It was my proxy settings problem. I made right clic on IntelliJ=>Maven=>Open Settings.xml
我的问题是固定的。这是我的代理设置问题。我在 IntelliJ=>Maven=>Open Settings.xml 上做了正确的点击
I update settings xml file by adding
我通过添加更新设置 xml 文件
<proxies>
<proxy>
<id>myproxy</id>
<active>true</active>
<protocol>http</protocol>
<host>myproxyhost</host>
<port>myproxyportnumber</port>
<username>myproxyusername</username>
<password>myproxpass</password>
<nonProxyHosts>*.google.com|ibiblio.org</nonProxyHosts>
</proxy>
</proxies>
回答by javasenior
You need to download libraries so right click project, go to "Maven" option in menu then click "ReImport" or "Download Sources and Documentation" option in sub menu. It will download libraries.
您需要下载库,因此右键单击项目,转到菜单中的“Maven”选项,然后单击子菜单中的“重新导入”或“下载源代码和文档”选项。它将下载库。
回答by Matthew E
I tried this and it worked, "Right click on the pom.xml file", and select "Add as maven project"
我试过了,它起作用了,“右键单击 pom.xml 文件”,然后选择“添加为 maven 项目”
It should resolve or reimport all the dependencies, and it should work.
它应该解决或重新导入所有依赖项,并且应该可以工作。
回答by Sukma Wardana
You need to download all of the spring-boot dependencies, and because I see pom.xml
in your project I assume you're using Maven as build tools. In order to download the dependencies you can execute command mvn clean install
on your command line.
您需要下载所有 spring-boot 依赖项,并且因为我pom.xml
在您的项目中看到我假设您使用 Maven 作为构建工具。为了下载依赖项,您可以mvn clean install
在命令行上执行命令。
I'm sorry I'm not very familiar with Intellij, but you can also execute Maven command in Intellij you can check the documentation
抱歉我对 Intellij 不是很熟悉,但是你也可以在 Intellij 中执行 Maven 命令你可以查看文档
回答by blaker
I realize this is an old question, but just in case it helps someone else:
我意识到这是一个老问题,但以防万一它对其他人有帮助:
If you have more than one Java sdk installed you need to specify the java version you want to use before you can rebuild.
如果您安装了多个 Java sdk,则需要在重新构建之前指定要使用的 Java 版本。
In IntelliJ Idea: File --> Project Structure --> Project Select your Project SDK, then rebuild the project
在 IntelliJ Idea 中: File --> Project Structure --> Project 选择你的 Project SDK,然后重建项目
that worked for me...
那对我有用...