- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Importing Commons-Lang?
Fri, 2009-02-06, 05:25
'm trying to "import org.apache.commons.lang.StringUtils", but when I do that, I'm getting an error
saying "value lang is not a member of package org.apache.commons".
I beg to differ: http://commons.apache.org/lang/api-release/org/apache/commons/lang/packa...
I'm building via the scalc ant task using the same classpath as everything else (which is compiling
and referencing Commons-Lang).
From my gant script:
ant.scalac(srcdir:'src/scala', destdir:'classes', classpathref:compilePath) {
ant.include(name:'**/*.scala')
}
~~ Robert Fischer.
Grails Trainining http://GroovyMag.com/training
Smokejumper Consulting http://SmokejumperIT.com
Enfranchised Mind Blog http://EnfranchisedMind.com/blog
Check out my book, "Grails Persistence with GORM and GSQL"!
http://www.smokejumperit.com/redirect.html
Fri, 2009-02-06, 07:47
#2
Re: Importing Commons-Lang?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
We have resolved it on IRC.
Jorge Ortiz wrote:
> Works for me?
>
> jorge-ortizs-macbook-pro:apache-commons jeortiz$ ls Test.scala
> commons-lang-2.4.jar jorge-ortizs-macbook-pro:apache-commons
> jeortiz$ cat Test.scala import org.apache.commons.lang.StringUtils
>
> object Test { def main(args: Array[String]) {
> println(StringUtils.upperCase("Hello, world!")) } }
> jorge-ortizs-macbook-pro:apache-commons jeortiz$ scalac -cp
> commons-lang-2.4.jar Test.scala
> jorge-ortizs-macbook-pro:apache-commons jeortiz$ scala -cp
> commons-lang-2.4.jar:. Test HELLO, WORLD!
> jorge-ortizs-macbook-pro:apache-commons jeortiz$
>
> --j
>
> On Thu, Feb 5, 2009 at 8:24 PM, Robert Fischer
> > wrote:
>
> 'm trying to "import org.apache.commons.lang.StringUtils", but when
> I do that, I'm getting an error saying "value lang is not a member
> of package org.apache.commons".
>
> I beg to differ:
> http://commons.apache.org/lang/api-release/org/apache/commons/lang/packa...
>
>
> I'm building via the scalc ant task using the same classpath as
> everything else (which is compiling and referencing Commons-Lang).
>
>> From my gant script:
> ant.scalac(srcdir:'src/scala', destdir:'classes',
> classpathref:compilePath) { ant.include(name:'**/*.scala') }
>
> ~~ Robert Fischer. Grails Trainining
> http://GroovyMag.com/training Smokejumper Consulting
> http://SmokejumperIT.com Enfranchised Mind Blog
> http://EnfranchisedMind.com/blog
>
> Check out my book, "Grails Persistence with GORM and GSQL"!
> http://www.smokejumperit.com/redirect.html
>
>
- --
Tony Morris
http://tmorris.net/
S, K and I ought to be enough for anybody.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFJi9pCmnpgrYe6r60RAvMBAJ9dd7AvXA9tCZMQ1QSAs2Hp+SuzlwCgn/Ku
0sgEBEs71anR+9DndGCSXJY=
=xoBb
-----END PGP SIGNATURE-----
jorge-ortizs-macbook-pro:apache-commons jeortiz$ ls
Test.scala commons-lang-2.4.jar
jorge-ortizs-macbook-pro:apache-commons jeortiz$ cat Test.scala
import org.apache.commons.lang.StringUtils
object Test {
def main(args: Array[String]) {
println(StringUtils.upperCase("Hello, world!"))
}
}
jorge-ortizs-macbook-pro:apache-commons jeortiz$ scalac -cp commons-lang-2.4.jar Test.scala
jorge-ortizs-macbook-pro:apache-commons jeortiz$ scala -cp commons-lang-2.4.jar:. Test
HELLO, WORLD!
jorge-ortizs-macbook-pro:apache-commons jeortiz$
--j
On Thu, Feb 5, 2009 at 8:24 PM, Robert Fischer <robert.fischer@smokejumperit.com> wrote: