- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
How to invoke the Java's static method?
Hi,
In Scala, I want to invoke a static method of a Java class, like the
parse() in org.joda.time.DateTime:
val t = DateTime.parse( value )
But the compile complaint that "error: value parse is not a member of
object org.joda.time.DateTime".
How to solve it?
In my other code, calling the static method of a Java class passes the
compilation, but sometime like the above does not. I do not know why.
Guofeng
Thanks










Re: How to invoke the Java's static method?
http://stackoverflow.com/questions/4445617/calling-a-protected-static-java-method-from-scala
Thanks,
-Vlad
On Sat, Feb 11, 2012 at 9:40 AM, Guofeng Zhang <guofeng [at] radvision [dot] com> wrote:
Re: How to invoke the Java's static method?
Nils,
You are right. I only node the tip on IDE, not pay attention to the
message displayed on the Problem panel. The message in that panel has
the following message:
[ERROR] error: error while loading DateTime, Missing dependency 'class
org.joda.convert.FromString', required by C:\.m2\repository\joda-time
\joda-time\2.0\joda-time-2.0.jar(org/joda/time/DateTime.class)
Re: How to invoke the Java's static method?
On Sat, Feb 11, 2012 at 12:40 PM, Guofeng Zhang <guofeng [at] radvision [dot] com> wrote: