1 买了本scala编程思想提前预习,看到衔接java这一章,例子中有调用Apache commons Math库
2 按照例子导入相关包
import com.atomicscala.AtomicTest._
import org.apache.commons.math3._
import stat.regression.SimpleRegression
3 执行编译,报错,提示找不到导入的包,该包我已下载并放到了scala的安装目录下的lib目录。
PS F:\BigData\scalaExe> scala -classpath $CLASSPATH:$SCALA_HOME/lib/commons-math3-3.6.jar .\ReachingintoJava.scala
F:\BigData\scalaExe\.\ReachingintoJava.scala:1: error: object atomicscala is not a member of package com
import com.atomicscala.AtomicTest._
^
F:\BigData\scalaExe\.\ReachingintoJava.scala:2: error: object apache is not a member of package org
import org.apache.commons.math3._
^
F:\BigData\scalaExe\.\ReachingintoJava.scala:3: error: not found: value stat
import stat.regression.SimpleRegression
^
F:\BigData\scalaExe\.\ReachingintoJava.scala:5: error: not found: type SimpleRegression
val r = new SimpleRegression