Wyy_Ck 发表于 2017-2-24 12:14:27

eclipse maven Scala编译出错

Scanning for projects...
                                                                        
------------------------------------------------------------------------
Building helloworld 0.0.1-SNAPSHOT
------------------------------------------------------------------------

--- maven-clean-plugin:2.5:clean (default-clean) @ helloworld ---
Deleting D:\Improve\24.Scala\workspace\helloworld\target

--- maven-scala-plugin:2.15.0:compile (default-cli) @ helloworld ---
Checking for multiple versions of scala
includes = [**/*.java,**/*.scala,]
excludes = []
D:\Improve\24.Scala\workspace\helloworld\src\main\scala:-1: info: compiling
Compiling 1 source files to D:\Improve\24.Scala\workspace\helloworld\target\classes at 1487909578577
D:\Improve\24.Scala\workspace\helloworld\src\main\scala\scala_helloworld\helloworld\Helloworld.scala:3: error: value apache is not a member of package org
import org.apache.hadoop.conf.Configuration
            ^
D:\Improve\24.Scala\workspace\helloworld\src\main\scala\scala_helloworld\helloworld\Helloworld.scala:4: error: value apache is not a member of package org
import org.apache.spark.{SparkContext, SparkConf}
            ^
D:\Improve\24.Scala\workspace\helloworld\src\main\scala\scala_helloworld\helloworld\Helloworld.scala:5: error: value apache is not a member of package org
import org.apache.spark.rdd.RDD
            ^
D:\Improve\24.Scala\workspace\helloworld\src\main\scala\scala_helloworld\helloworld\Helloworld.scala:6: error: value apache is not a member of package org
import org.apache.spark.SparkContext._
            ^
four errors found
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 5.757 s
Finished at: 2017-02-24T12:13:02+08:00
Final Memory: 10M/155M
------------------------------------------------------------------------
Failed to execute goal org.scala-tools:maven-scala-plugin:2.15.0:compile (default-cli) on project helloworld: wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 1(Exit value: 1) ->

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

sstutu 发表于 2017-2-24 12:36:25

D:\Improve\24.Scala\workspace\helloworld\src\main\scala\scala_helloworld\helloworld\Helloworld.scala:6: error: value apache is not a member of package org
看样子可能导包导错了

Wyy_Ck 发表于 2017-2-24 14:30:31

sstutu 发表于 2017-2-24 12:36
D:\Improve\24.Scala\workspace\helloworld\src\main\scala\scala_helloworld\helloworld\Helloworld.scala ...

类似这种错误 应该怎么看呢

Description        Resource        Path        Location        Type
akka-actor_2.10-2.3.11.jar of FemaleInfoCollection build path is cross-compiled with an incompatible version of Scala (2.10.0). In case this report is mistaken, this check can be disabled in the compiler preference page.        FemaleInfoCollection                Unknown        Scala Version Problem


Description        Resource        Path        Location        Type
akka-remote_2.10-2.3.11.jar of FemaleInfoCollection build path is cross-compiled with an incompatible version of Scala (2.10.0). In case this report is mistaken, this check can be disabled in the compiler preference page.        FemaleInfoCollection                Unknown        Scala Version Problem



我本地安装的Scala是2.11.8


页: [1]
查看完整版本: eclipse maven Scala编译出错