1
以下scala文件位于也包含子文件夹de \ tilman \ mathParser的文件夹中。在该子文件夹中找到java类MathMLParser。无法在scala中使用java代码
import de.tilman.mathParser.MathMLParser
object MathML2LaTeX{
def main(args: Array[String]) {
/*try {
val parser = new MathMLParser()
} catch {
case e: Exception => println("exception caught: " + e);
} */
}
}
如果我尝试编译:
%USERPROFILE%\Documents\MathMl2Latex\MathParser> scala MathML2LaTeX.scala
C:\Users\Aage\Documents\MathMl2Latex\MathParser\MathML2LaTeX.scala:1: error: not found: object de
import de.tilman.mathParser.MathMLParser
^
one error found
Process scala exited with code 1
我在一个简单的文本编辑这样做,这是一个很小的程序我写。只是想尝试在Scala中编写一些东西,我认为不应该在IDE中为这样的小事物启动项目。等待Netbeans加载可能会使“开发”时间增加50%。 (只需要在MathMLParser中以剪贴板中的文本作为参数调用方法,并将返回值放回剪贴板...)
这一个工作:scala -classpath。 MathML2LaTeX.scala谢谢!顺便说一下,这个点,它指的是我所谓的Scala的所有子文件夹? –
从技术上讲,它只是指当前目录,但java根据包名查找子目录。 –