You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

IntelliJ中「UNRESOLVED DEPENDENCIES」问题排查求助

Fixing SBT's MaxPermSize Warning When Setting Up Your Spark-Scala Project

Hey there! I see you're diving into Spark, Scala, and Hadoop—awesome stack to learn! Let's get that SBT issue sorted out so you can keep building your project.

First, let's break down what's happening: that warning about ignoring MaxPermSize is because Java 8 and later versions removed the Permanent Generation (PermGen) space entirely, replacing it with Metaspace. Any JVM arguments referencing MaxPermSize are now obsolete, which is why your SBT setup is throwing that warning.

Your Current build.sbt Config

name := "untitled2"
version := "0.1"
scalaVersion := "2.12.5"
val sparkVersion = "2.3.0"
libraryDependencies ++= Seq(
  "org.apache.spark" %% "spark-core" % sparkVersion
)

The Error You're Seeing

Error while importing sbt project: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPer...

How to Fix This

Here are a few straightforward steps to resolve the warning:

  • Check your Java version: Run java -version in your terminal to confirm you're using Java 8 or newer. If you're on an older version (like Java 7), consider upgrading since Spark 2.3.0 supports Java 8+ anyway.
  • Update SBT's JVM configuration:
    1. In your project root directory, create a file named .sbtopts (if it doesn't exist already).
    2. Open it and remove any line that includes -XX:MaxPermSize=.... If you need to adjust memory settings for Metaspace, use -XX:MaxMetaspaceSize=256m (or your preferred value) instead.
  • Fix IDE-specific settings (if using IntelliJ/Eclipse):
    • In IntelliJ, go to File > Settings > Build, Execution, Deployment > Build Tools > sbt.
    • Under the "JVM options" section, delete any reference to MaxPermSize.
    • Click "Apply" and reimport your SBT project.

Once you make these changes, refresh your SBT project again—the warning should disappear, and your dependencies should import correctly.

内容的提问来源于stack exchange,提问作者JeanP

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 11:26:36