I'm using intellij 14.0.2 build#ic-139.659 and scala plugin 1.2.1
Im working on a basic project for a while and everything went well until i rename a package name.
Since then im getting this error and i cant compile and run the program
Error:(10, 8) not found: object Repo
import Repo._
^
When i'm generating the same code to eclipse it compile and run well.
Is that a bug or i`m doing something wrong ?
thanks,
miki
Related
I created a basic Scala Dotty project using Dotty template and import the project to IntelliJ IDE.
Everything works fine when I use the sbt command line.
When I try to build or run it inside IntelliJ IDE, I got following errors:
Error:scalac: Multiple 'scala-library*.jar' files (scala-library-0.9.0-RC1.jar, scala-library-2.12.6.jar) in Scala compiler classpath in Scala SDK sbt: ch.epfl.lamp:dotty-library_0.9:0.9.0-RC1:jar
Any ideas how to solve this?
IDE support for Dotty
Currently, the only IDE we officially support is Visual Studio Code.
Anyway when you import a project to IntelliJ IDEA check "use sbt shell". At least for me after that a test project compiles and runs with Ctrl+Shift+F10.
It's possible that not everything will work. For example Dotty macros don't but if I compile and run manually then they do.
I used Intellij for 4 months without any problems. Yesterday I installed it on another PC but I can't create a SBT Scala project.
Here the steps:
I create the project:
When started it says me that "SBT project need to be imported" so I click on "Enable Auto-Import" but then I get this error:
If I try to add Scala SDK from modules settings I get this error:
I downloaded Scala and SBT externally, I also tried all the suggested solutions from other similar threads but I can't resolve it.
How can I do?
Thank you in advance!
Add sbt.version to project/build.properties. You can check SBT version using sbt sbtVersion.
I have a simple Play project with one controller (with a route) and a unittest.
When I type "sbt compile test" into terminal it runs fine and the test passes.
I cannot get the solution to compile correctly in IntelliJ however.
Controller: controllers.nisp.LandingPageController
Compile error:
.../nisp-frontend/target/scala-2.11/src_managed/main/app/routes_routing.scala
Error:(37, 18) object LandingPageController is not a member of package app.controllers.nisp
controllers.nisp.LandingPageController.showLandingPage(),
^
Directory structure:
I have solved this issue using the following method:
Upgrade to Intellij 14
Upgrade to the latest scala plugin.
Remove the whole project directory and re-cloned the source.
Use File -> Import Project -> SBT -> Auto-Import.
I am trying to compile Orbeon Forms in IntelliJ IDEA 14.0.1 Community Edition, but I am getting compile errors.
Checked out the branch origin/4.7-ce
Opened the project with IntelliJ
Got on error: Load error: undefined path variables. MESSAGE is undefined. Fix it
Fixed the MESSAGE error by entering C:\temp as the value. I don't know if this matters.
Installed the Scala and File Watchers plugins
Configured the Java SDK as jdk1.7.0_09
Removed the scala-sdk that was referencing non-existent scala compiler, library, reflect jars in my $USER_HOME\.ivy2\cache directory.
Installed the Scala 2.10.3 SDK and configured as a library in the project.
Make Project
Got 94 errors, all related to the util and xml packages. I would have expected the packages to be scala.util and scala.xml.
Example errors:
orbeon-forms\src\main\scala\org\orbeon\oxf\common\PEVersion.scala
Error:(34, 8) object Try is not a member of package util<br/>
import util.Try
orbeon-forms\src\main\scala\org\orbeon\oxf\fb\AlertsAndConstraintsOps.scala<br/>
Error:(46, 9) type mismatch;<br/>
found : scala.xml.Elem<br/>
required: org.orbeon.saxon.om.NodeInfo<br/>
toXML currentLang<br/>
What am I doing wrong?
I was able to fix this error by changing the import from:
import util.Try to import scala.util.Try
There were other files that had the same issue with the scala.xml package.
The full list of files I changed is:
src\main\scala\org\orbeon\oxf\common\PEVersion.scala
src\main\scala\org\orbeon\oxf\fr\mongodb\MongoDBPersistence.scala
src\main\scala\org\orbeon\oxf\fr\process\ProcessInterpreter.scala
src\main\scala\org\orbeon\oxf\fr\process\SimpleProcess.scala
src\main\scala\org\orbeon\oxf\fr\process\XFormsActions.scala
src\main\scala\org\orbeon\oxf\xforms\action\XFormsAPI.scala
src\main\scala\org\orbeon\oxf\xforms\analysis\ElementAnalysis.scala
src\main\scala\org\orbeon\oxf\xforms\analysis\PathMapXPathAnalysis.scala
src\main\scala\org\orbeon\oxf\xforms\control\controls\XFormsInputControl.scala
src\main\scala\org\orbeon\scaxon\XML.scala
src\test\scala\org\orbeon\oxf\common\VersionTest.scala
When trying to import scala.Option in a javafx script, I get the following javafxc error:
cannot access scala.Option.$anonfun$orNull$1
bad class file: scala/Option$$anonfun$orNull$1.class(scala:Option$$anonfun$orNull$1.class)
undeclared type variable: A1
Please remove or make sure it appears in the correct subdirectory of the classpath.
import scala.Option;
I am using Scala 2.8.1, Javafxc 1.3.1_b101, JVM 1.6.0_21-b06, OS Ubuntu 10.10. The same code was working in Scala 2.7.7 .
Later edit:
The same error is reported in case I import scala.immutable.Seq/List/Traversable/Iterable . I have tried the imports in a default Netbeans 6.9.1 JavaFX project which has in the classpath only scala-library.jar.
It reminded me first of #4067, but this one looks quite different.
I would suggest that you try to reproduce the error with 2.8.1 or 2.9 trunk, maybe it is fixed?