English 中文(简体)
物体apache不是包件org的成员
原标题:Object apache is not a member of package org
  • 时间:2011-11-21 12:15:33
  •  标签:
  • scala
import org.apache.tools.ant.Project

object HelloWorld {
   def main(args: Array[String]) {
      println("Hello, world!")
   }
}

我试图通过下列指挥来实施这一法典:

java -cp D:	oolsapache-ant-1.7.0libant.jar;D:	oolsscala-2.9.1.finallibscala-compiler.jar;D:	oolsscala-2.9.1.finallibscala-library.jar -Dscala.usejavacp=true scala.tools.nsc.MainGenericRunner D:	estscalaant.scala

www.un.org/Depts/DGACM/index_spanish.htm 以下错误:。

D:	estscalaant.scala:1: error: object apache is not a member of package org
import org.apache.tools.ant.Project
           ^
one error found

什么是错的?

UPDATE:
As I can see it is impossible to import any org.xxx package.
The same problem with javax.xml.xxx package.

D:	est	est2.scala:2: error: object crypto is not a member of package javax.xml
import javax.xml.crypto.Data
                 ^
one error found  

实际上,我不能进口任何东西!

D:	est	est3.scala:3: error: object test is not a member of package com
import com.test.utils.ant.taskdefs.SqlExt
           ^
one error found
最佳回答

我试验了scala.bat(对最后指挥线的回复,见从开始的“%_JAVACMD%”......),并认为这项工作应当:

java -Dscala.usejavacp=true -cp d:Devscala-2.9.1.finallibscala-compiler.jar;d:Devscala-2.9.1.finallibscala-library.jar scala.tools.nsc.MainGenericRunner -cp d:Devapache-ant-1.8.2libant.jar D:	estscalaant.scala
问题回答

你的头号把ant的卷宗列入你的班子。

汇编者有效地建立了代表封套结构的物体。 已经有了一个称为“JDK”(例如,org.xml)的顶级一揽子计划,但没有增加“jars org”。 apache没有。

我发现,一般而言,当类型<代码>的错误发生时。 目标三十不是第YYY一揽子计划的成员,应当:

检查你的所有档案都属于一揽子,即。 页: 1 名录

我要检查的是,D: oolsapache-ant-1.7.0libant.jar已经存在,并且还检查它不是腐败的(从0或无法与jar tf D开放: oolsapache-ant-1.7.0libant.jar)。

而是用沙拉指挥:

scala -cp D: oolsapache-ant-1.7.0libant.jar;D: oolsscala-2.9.1.finallibscala-compiler.jar;D: oolsscala-2.9.1.finallibscala-library.jar D: estscalaant.scala





相关问题
How to flatten a List of different types in Scala?

I have 4 elements:List[List[Object]] (Objects are different in each element) that I want to zip so that I can have a List[List[obj1],List[obj2],List[obj3],List[obj4]] I tried to zip them and I ...

To use or not to use Scala for new Java projects? [closed]

I m impressed with Twitter and investigating to use Scala for a new large scale web project with Hibernate and Wicket. What do you think about Scala, and should I use it instead of Java? EDIT: And, ...

Why does Scala create a ~/tmp directory when I run a script?

When I execute a Scala script from the command line, a directory named "tmp" is created in my home directory. It is always empty, so I simply deleted it without any apparent problem. Of course, when I ...

Include jar file in Scala interpreter

Is it possible to include a jar file run running the Scala interpreter? My code is working when I compile from scalac: scalac script.scala -classpath *.jar But I would like to be able to include a ...

Scala and tail recursion

There are various answers on Stack Overflow which explain the conditions under which tail recursion is possible in Scala. I understand the limitations and how and where I can take advantage of tail ...

热门标签