问题
I'm trying to import a PlayFramework 2.4 project into IntelliJ 14.1.3. I failed to import existing one (created in pre-2.4), so made these steps:
- Created a new play-java project via activator:
activator new appName
- Tried to open the created project via IntelliJ. (Opened the Open dialog, then selected the folder with my app, then set JDK to 1.8.0_45)
I'm getting this exception:
Error while importing SBT project: ... at
scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:34) at
scala.collection.TraversableLike$class.map(TraversableLike.scala:244) at
scala.collection.AbstractTraversable.map(Traversable.scala:105) at
sbt.Classpaths$.appRepositories(Defaults.scala:1729) at
sbt.Classpaths$$anonfun$41.apply(Defaults.scala:1102) at
sbt.Classpaths$$anonfun$41.apply(Defaults.scala:1102) at
scala.Function1$$anonfun$compose$1.apply(Function1.scala:47) at
scala.Function1$$anonfun$compose$1.apply(Function1.scala:47) at
sbt.EvaluateSettings$MixedNode.evaluate0(INode.scala:175) at
sbt.EvaluateSettings$INode.evaluate(INode.scala:135) at
sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$submitEvaluate$1.apply$mcV$sp(INode.scala:69) at
sbt.EvaluateSettings.sbt$EvaluateSettings$$run0(INode.scala:78) at
sbt.EvaluateSettings$$anon$3.run(INode.scala:74) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745) [error]
java.lang.IllegalArgumentException: URI has an authority component [error] Use
'last' for the full log. Invalid response. Java HotSpot(TM) 64-Bit Server VM
warning: ignoring option MaxPermSize=384M; support was removed in 8.0 See
complete log in D:\.IntelliJIdea\system\log\sbt.last.log
sbt.last.log:
java.lang.IllegalArgumentException: URI has an authority component
at java.io.File.<init>(File.java:423)
at sbt.Classpaths$.sbt$Classpaths$$bootRepository(Defaults.scala:1758)
at sbt.Classpaths$$anonfun$appRepositories$1.apply(Defaults.scala:1729)
at sbt.Classpaths$$anonfun$appRepositories$1.apply(Defaults.scala:1729)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:34)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at sbt.Classpaths$.appRepositories(Defaults.scala:1729)
at sbt.Classpaths$$anonfun$41.apply(Defaults.scala:1102)
at sbt.Classpaths$$anonfun$41.apply(Defaults.scala:1102)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
at sbt.EvaluateSettings$MixedNode.evaluate0(INode.scala:175)
at sbt.EvaluateSettings$INode.evaluate(INode.scala:135)
at sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$submitEvaluate$1.apply$mcV$sp(INode.scala:69)
at sbt.EvaluateSettings.sbt$EvaluateSettings$$run0(INode.scala:78)
at sbt.EvaluateSettings$$anon$3.run(INode.scala:74)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[error] java.lang.IllegalArgumentException: URI has an authority component
[error] Use 'last' for the full log.
Invalid response.
回答1:
The solution was to delete all .sbt, .ivy, .m2 folders in user home folder. Also I've removed SBT_HOME system variable. After that, IntelliJ was able to create valid project.
回答2:
On windows just delete folder: C:\Users\.sbt Check sbt command on your system is ok before launch intellij
来源:https://stackoverflow.com/questions/30665030/playframework-2-4-and-intellij-14