当前位置: 首页 > 知识库问答 >
问题:

在IntelliJ IDEA中创建Scala项目时应注意的问题

师增
2023-03-14

所以我一直试图在IntelliJ IDEA中使用SBT创建一个Scala项目。我已经下载了JetBrains Scala插件。我的系统需要一个代理连接到internet,我在IntelliJ IDEA代理设置中设置了这个代理,我还设置了所有与环境相关的JAVA_HOME、SCALA_HOME、HTTP_PROXY

堆栈跟踪附在下面。

[info] Loading project definition from D:\Java\Scala\Coursera\HelloTest03\project
[info] Set current project to HelloTest03 (in build file:/D:/Java/Scala/Coursera/HelloTest03/)
[info] Defining *:shellPrompt
[info] The new value will be used by no settings or tasks.
[info] Reapplying settings...
[info] Set current project to HelloTest03 (in build file:/D:/Java/Scala/Coursera/HelloTest03/)
[info] Defining */*:sbtStructureOutputFile
[info] The new value will be used by no settings or tasks.
[info] Reapplying settings...
[info] Set current project to HelloTest03 (in build file:/D:/Java/Scala/Coursera/HelloTest03/)
[info] Defining */*:sbtStructureOptions
[info] The new value will be used by no settings or tasks.
[info] Reapplying settings...
[info] Set current project to HelloTest03 (in build file:/D:/Java/Scala/Coursera/HelloTest03/)
[info] Applying State transformations org.jetbrains.sbt.CreateTasks from C:/Users/973855/.IdeaIC2016.3/config/plugins/Scala/launcher/sbt-structure-0.13.jar
[info] Reapplying settings...
[info] Set current project to HelloTest03 (in build file:/D:/Java/Scala/Coursera/HelloTest03/)
[info] Resolving org.scala-sbt#sbt;0.13.13 ...
[info] Resolving org.scala-lang#scala-library;2.10.6 ...
[info] Resolving org.scala-sbt#main;0.13.13 ...
[info] Resolving org.scala-sbt#actions;0.13.13 ...
[info] Resolving org.scala-sbt#classpath;0.13.13 ...
[info] Updating {file:/D:/Java/Scala/Coursera/HelloTest03/}hellotest03...
[info] Resolving org.scala-lang#scala-compiler;2.10.6 ...
[info] Resolving org.scala-lang#scala-reflect;2.10.6 ...
[info] Resolving org.scala-sbt#interface;0.13.13 ...
[info] Resolving org.scala-sbt#io;0.13.13 ...
[info] Resolving org.scala-sbt#control;0.13.13 ...
[info] Resolving org.scala-sbt#launcher-interface;1.0.0-M1 ...
[info] Resolving org.scala-sbt#completion;0.13.13 ...
[info] Resolving org.scala-sbt#collections;0.13.13 ...
[info] Resolving jline#jline;2.13 ...
[info] Resolving org.fusesource.jansi#jansi;1.11 ...
[info] Resolving org.scala-sbt#api;0.13.13 ...
[info] Resolving org.scala-sbt#classfile;0.13.13 ...
[info] Resolving org.scala-sbt#logging;0.13.13 ...
[info] Resolving org.scala-sbt#process;0.13.13 ...
[info] Resolving org.scala-sbt#compiler-integration;0.13.13 ...
[info] Resolving org.scala-sbt#incremental-compiler;0.13.13 ...
[info] Resolving org.scala-sbt#relation;0.13.13 ...
[info] Resolving org.scala-sbt#compile;0.13.13 ...
[info] Resolving org.scala-sbt#persist;0.13.13 ...
[info] Resolving org.scala-tools.sbinary#sbinary_2.10;0.4.2 ...
[info] Resolving org.scala-sbt#compiler-ivy-integration;0.13.13 ...
[info] Resolving org.scala-sbt#ivy;0.13.13 ...
[info] Resolving org.scala-sbt#cross;0.13.13 ...
[info] Resolving org.scala-sbt.ivy#ivy;2.3.0-sbt-2cf13e211b2cb31f0d3b317289dca70eca3362f6 ...
[info] Resolving com.jcraft#jsch;0.1.50 ...
[info] Resolving org.scala-sbt#serialization_2.10;0.1.2 ...
[info] Resolving org.scala-lang.modules#scala-pickling_2.10;0.10.1 ...
[info] Resolving org.scalamacros#quasiquotes_2.10;2.0.1 ...
[info] Resolving org.json4s#json4s-core_2.10;3.2.10 ...
[info] Resolving org.json4s#json4s-ast_2.10;3.2.10 ...
[info] Resolving com.thoughtworks.paranamer#paranamer;2.6 ...
[info] Resolving org.spire-math#jawn-parser_2.10;0.6.0 ...
[info] Resolving org.spire-math#json4s-support_2.10;0.6.0 ...
[info] Resolving org.scala-sbt#run;0.13.13 ...
[info] Resolving org.scala-sbt#task-system;0.13.13 ...
[info] Resolving org.scala-sbt#tasks;0.13.13 ...
[info] Resolving org.scala-sbt#tracking;0.13.13 ...
[info] Resolving org.scala-sbt#cache;0.13.13 ...
[info] Resolving org.scala-sbt#testing;0.13.13 ...
[info] Resolving org.scala-sbt#test-agent;0.13.13 ...
[info] Resolving org.scala-sbt#test-interface;1.0 ...
[info] Resolving org.scala-sbt#main-settings;0.13.13 ...
[info] Resolving org.scala-sbt#apply-macro;0.13.13 ...
[info] Resolving org.scala-sbt#command;0.13.13 ...
[info] Resolving org.scala-sbt#template-resolver;0.1 ...
[info] Resolving org.scala-sbt#logic;0.13.13 ...
[info] Resolving org.scala-sbt#compiler-interface;0.13.13 ...
[info] Resolving org.scala-lang#scala-library;2.12.1 ...
[info] Resolving org.scala-lang#scala-library;2.12.1 ...
[warn] Host repo1.maven.org not found. url=https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.1/scala-library-2.12.1.pom
[info] You probably access the destination server through a proxy server that is not well configured.
[warn]  module not found: org.scala-lang#scala-library;2.12.1
[warn] ==== local: tried
[warn]   C:\Users\973855\.ivy2\local\org.scala-lang\scala-library\2.12.1\ivys\ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.12.1/scala-library-2.12.1.pom
[warn] ==== activator-launcher-local: tried
[warn]   C:\Users\973855\.activator\repository\org.scala-lang\scala-library\2.12.1\ivys\ivy.xml
[warn] ==== activator-local: tried
[warn]   D:\Java\Scala\activator-dist-1.3.12\repository\org.scala-lang\scala-library\2.12.1\ivys\ivy.xml
[warn] ==== typesafe-releases: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/scala-lang/scala-library/2.12.1/scala-library-2.12.1.pom
[warn] ==== typesafe-ivy-releasez: tried
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang/scala-library/2.12.1/ivys/ivy.xml
[info] Resolving org.scala-lang#scala-compiler;2.12.1 ...
[info] Resolving org.scala-lang#scala-compiler;2.12.1 ...
[warn] Host repo1.maven.org not found. url=https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.12.1/scala-compiler-2.12.1.pom
[info] You probably access the destination server through a proxy server that is not well configured.
[warn]  module not found: org.scala-lang#scala-compiler;2.12.1
[warn] ==== local: tried
[warn]   C:\Users\973855\.ivy2\local\org.scala-lang\scala-compiler\2.12.1\ivys\ivy.xml
[warn] ==== public: tried
[warn]   https://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.12.1/scala-compiler-2.12.1.pom
[warn] ==== activator-launcher-local: tried
[warn]   C:\Users\973855\.activator\repository\org.scala-lang\scala-compiler\2.12.1\ivys\ivy.xml
[warn] ==== activator-local: tried
[warn]   D:\Java\Scala\activator-dist-1.3.12\repository\org.scala-lang\scala-compiler\2.12.1\ivys\ivy.xml
[warn] ==== typesafe-releases: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/scala-lang/scala-compiler/2.12.1/scala-compiler-2.12.1.pom
[warn] ==== typesafe-ivy-releasez: tried
[warn]   http://repo.typesafe.com/typesafe/ivy-releases/org.scala-lang/scala-compiler/2.12.1/ivys/ivy.xml
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.scala-lang#scala-library;2.12.1: not found
[warn]  :: org.scala-lang#scala-compiler;2.12.1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn] 
[warn]  Note: Unresolved dependencies path:
[warn]      org.scala-lang:scala-library:2.12.1 ((sbt.Classpaths) Defaults.scala#L1293)
[warn]        +- default:hellotest03_2.12:1.0
[warn]      org.scala-lang:scala-compiler:2.12.1
[warn]        +- default:hellotest03_2.12:1.0
[trace] Stack trace suppressed: run 'last *:update' for the full output.
[trace] Stack trace suppressed: run 'last *:ssExtractDependencies' for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: org.scala-lang#scala-library;2.12.1: not found
[error] unresolved dependency: org.scala-lang#scala-compiler;2.12.1: not found
[error] (*:ssExtractDependencies) sbt.ResolveException: unresolved dependency: org.scala-lang#scala-library;2.12.1: not found
[error] unresolved dependency: org.scala-lang#scala-compiler;2.12.1: not found
[error] Total time: 157 s, completed Feb 27, 2017 2:52:34 PM
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384M; support was removed in 8.0

共有1个答案

范朗
2023-03-14

删除~/.ivy2目录并重新导入。

我更喜欢下载activator包https://www.lightbend.com/activator/download并使用它构建我的项目

 类似资料:
  • 我已经创建了一个包,通过导入其他程序员的代码来供他们使用。我的程序使用其他jar文件进行XML解析,我不想让其他人担心依赖关系,什么是确保我的jar文件总是获得它的依赖关系的最佳方法? 是否应在原始JAR中包含依赖项? 有其他方法吗?

  • ... 尽管它将创建项目和正确的结构。但是当我进入项目的新文件夹并运行sbt命令时,出现了这个错误: 我使用JDK 1.8、sbt 0.13.16和Scala IDE 4.7.0 为什么会这样?我该怎么解决呢?

  • 我正在学习使用laravel创建项目,我正在使用PHP8。通过“laravel新建项目”创建新项目时。我得到了这个错误,供应商文件夹在该项目中丢失。

  • 我为Spark Scala创建了一个maven项目,并编写了一些代码。我必须将它绑定为一个JAR文件,并从边缘节点(shell环境)运行它。但我正面临以下错误。请告知 [ERROR]无法执行目标org.scala-tools:maven-scala-plugin:2.11:compile(default)在项目XYZ上:目标org:Execution default.scala-tools:mav

  • 当我想要在中创建一个新的项目时,当我进入命名项目的阶段时,我会收到以下错误消息: "无法自动设置JavaFX平台。请转到Platform Manager,创建一个非默认JavaSE平台,然后转到JavaFX选项卡,启用JavaFX并填写有效JavaFX SDK和JavaFX运行时的路径。注意:JavaFX SDK可从JavaFX网站下载” 我如何解决这个问题?

  • 我们是否需要分别安装hadoop和spark,在hadoop home上设置winutils并配置环境变量 我们创建maven项目,并在POM文件上编写所有依赖项。