This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Importing Commons-Lang?

2 replies
Robert Fischer
Joined: 2009-01-31,
User offline. Last seen 42 years 45 weeks ago.

'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

Jorge Ortiz
Joined: 2008-12-16,
User offline. Last seen 29 weeks 3 days ago.
Re: Importing Commons-Lang?
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 <robert [dot] fischer [at] smokejumperit [dot] com> 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/package-frame.html

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
Joined: 2008-12-19,
User offline. Last seen 30 weeks 4 days ago.
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-----

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland