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

joda time 2.0

5 replies
Jan Kriesten
Joined: 2009-01-13,
User offline. Last seen 2 years 39 weeks ago.

Hi,

I just tried to use joda time 2.0 (from the maven repo) with scala
2.9.0-1. It seems that the compiler can't analyze the lib:

[INFO] ...: info: compiling
[INFO] Compiling 3 source files to .../target/classes at 1312527976035
[ERROR] error: error while loading DateTime, Missing dependency 'class
org.joda.convert.FromString', required by
/Users/kriesten/.m2/repository/joda-time/joda-time/2.0/joda-time-2.0.jar(org/joda/time/DateTime.class)
[ERROR] error: error while loading AbstractInstant, Missing dependency
'class org.joda.convert.ToString', required by
/Users/kriesten/.m2/repository/joda-time/joda-time/2.0/joda-time-2.0.jar(org/joda/time/base/AbstractInstant.class)
[ERROR] .../Converter.scala:20: error: org.joda.time.DateTime does not
have a constructor
[INFO] new DateTime( date )
[INFO] ^
[ERROR] three errors found

This works fine with joda time 1.6.2. I double checked the 2.0 jar is
ok, also, the files can be decompiled fine using jad.

Any hint what might go wrong here?

Best regards, --- Jan.

Jason Zaugg
Joined: 2009-05-18,
User offline. Last seen 38 weeks 5 days ago.
Re: joda time 2.0

You need to explicitly include 'joda-convert', which is marked as a
optional dependency in the joda-time POM [1]

org.joda
joda-convert
1.1

The Scala compiler requires that all classes referenced in signatures
of classes that you use are also available on the compile time
classpath.

-jason

[1] http://search.maven.org/remotecontent?filepath=joda-time/joda-time/2.0/j...

On Fri, Aug 5, 2011 at 9:09 AM, Jan Kriesten wrote:
>
> Hi,
>
> I just tried to use joda time 2.0 (from the maven repo) with scala
> 2.9.0-1. It seems that the compiler can't analyze the lib:
>
> [INFO] ...: info: compiling
> [INFO] Compiling 3 source files to .../target/classes at 1312527976035
> [ERROR] error: error while loading DateTime, Missing dependency 'class
> org.joda.convert.FromString', required by
> /Users/kriesten/.m2/repository/joda-time/joda-time/2.0/joda-time-2.0.jar(org/joda/time/DateTime.class)
> [ERROR] error: error while loading AbstractInstant, Missing dependency
> 'class org.joda.convert.ToString', required by
> /Users/kriesten/.m2/repository/joda-time/joda-time/2.0/joda-time-2.0.jar(org/joda/time/base/AbstractInstant.class)
> [ERROR] .../Converter.scala:20: error: org.joda.time.DateTime does not
> have a constructor
> [INFO]     new DateTime( date )
> [INFO]     ^
> [ERROR] three errors found
>
> This works fine with joda time 1.6.2. I double checked the 2.0 jar is
> ok, also, the files can be decompiled fine using jad.
>
> Any hint what might go wrong here?
>
> Best regards, --- Jan.
>
>

JodaStephen
Joined: 2011-08-06,
User offline. Last seen 42 years 45 weeks ago.
Re: joda time 2.0

This library dependency should be optional. Annotations in Java are
optional - if they aren't found, the class still loads and runs.
Clearly Scala isn't respecting that.

I only included this in Joda-Time because of how Java annotations are
optional. No one should be forced to pick this up this as a
dependency. Can Scala be changed/fixed?

Stephen

On Aug 5, 8:18 am, Jason Zaugg wrote:
> You need to explicitly include 'joda-convert', which is marked as a
> optional dependency in the joda-time POM [1]
>
>
>   org.joda
>   joda-convert
>   1.1
>
>
> The Scala compiler requires that all classes referenced in signatures
> of classes that you use are also available on the compile time
> classpath.
>
> -jason
>
> [1]http://search.maven.org/remotecontent?filepath=joda-time/joda-time/2....
>
>
>
>
>
>
>
> On Fri, Aug 5, 2011 at 9:09 AM, Jan Kriesten wrote:
>
> > Hi,
>
> > I just tried to use joda time 2.0 (from the maven repo) with scala
> > 2.9.0-1. It seems that the compiler can't analyze the lib:
>
> > [INFO] ...: info: compiling
> > [INFO] Compiling 3 source files to .../target/classes at 1312527976035
> > [ERROR] error: error while loading DateTime, Missing dependency 'class
> > org.joda.convert.FromString', required by
> > /Users/kriesten/.m2/repository/joda-time/joda-time/2.0/joda-time-2.0.jar(org/joda/time/DateTime.class)
> > [ERROR] error: error while loading AbstractInstant, Missing dependency
> > 'class org.joda.convert.ToString', required by
> > /Users/kriesten/.m2/repository/joda-time/joda-time/2.0/joda-time-2.0.jar(org/joda/time/base/AbstractInstant.class)
> > [ERROR] .../Converter.scala:20: error: org.joda.time.DateTime does not
> > have a constructor
> > [INFO]     new DateTime( date )
> > [INFO]     ^
> > [ERROR] three errors found
>
> > This works fine with joda time 1.6.2. I double checked the 2.0 jar is
> > ok, also, the files can be decompiled fine using jad.
>
> > Any hint what might go wrong here?
>
> > Best regards, --- Jan.

Jason Zaugg
Joined: 2009-05-18,
User offline. Last seen 38 weeks 5 days ago.
Re: Re: joda time 2.0

On Sat, Aug 6, 2011 at 1:18 PM, JodaStephen wrote:
> This library dependency should be optional. Annotations in Java are
> optional - if they aren't found, the class still loads and runs.
> Clearly Scala isn't respecting that.
>
> I only included this in Joda-Time because of how Java annotations are
> optional. No one should be forced to pick this up this as a
> dependency. Can Scala be changed/fixed?

You only need it at compile time, use the "provided" scope in Maven for that.

-jason

Tim P
Joined: 2011-07-28,
User offline. Last seen 1 year 4 weeks ago.
Re: joda time 2.0

Has anyone any suggests as to what I can do about this as a user?
I'm compiling within intellij using the scala module.

The problem is that I get this;
error while loading Period, Missing dependency 'class
org.joda.convert.FromString', required by C:\programmingExperiments
\joda-time-2.0\joda-time-2.0.jar(org/joda/time/Period.class)

repeated for each of the types at the top of the Make error list. It
doesn't tell me which or what I need to modify in order to make it go
away.
Does this mean I simply can't make it compile, or do I have to go
around importing org.joda.time.convert._into every scala file that
requires it?

Has anybody any interest in sorting this out? Or are you just going to
blame each other? Right now it looks like I've got to go back to a
previous version of jodatime, which is a shame because I do use joda
everywhere.

Tim

On Aug 6, 12:18 pm, JodaStephen wrote:
> This library dependency should be optional. Annotations in Java are
> optional - if they aren't found, the class still loads and runs.
> Clearly Scala isn't respecting that.
>
> I only included this inJoda-Time because of how Java annotations are
> optional. No one should be forced to pick this up this as a
> dependency. Can Scala be changed/fixed?
>
> Stephen
>
> On Aug 5, 8:18 am, Jason Zaugg wrote:
>
>
>
>
>
>
>
> > You need to explicitly include 'joda-convert', which is marked as a
> > optional dependency in thejoda-time POM [1]
>
> >
> >   org.joda
> >   joda-convert
> >   1.1
> >
>
> > The Scala compiler requires that all classes referenced in signatures
> > of classes that you use are also available on the compile time
> > classpath.
>
> > -jason
>
> > [1]http://search.maven.org/remotecontent?filepath=joda-time/joda-time/2....
>
> > On Fri, Aug 5, 2011 at 9:09 AM, Jan Kriesten wrote:
>
> > > Hi,
>
> > > I just tried to usejodatime 2.0 (from the maven repo) with scala
> > > 2.9.0-1. It seems that the compiler can't analyze the lib:
>
> > > [INFO] ...: info: compiling
> > > [INFO] Compiling 3 source files to .../target/classes at 1312527976035
> > > [ERROR] error: error while loading DateTime, Missing dependency 'class
> > > org.joda.convert.FromString', required by
> > > /Users/kriesten/.m2/repository/joda-time/joda-time/2.0/joda-time-2.0.jar(or g/joda/time/DateTime.class)
> > > [ERROR] error: error while loading AbstractInstant, Missing dependency
> > > 'class org.joda.convert.ToString', required by
> > > /Users/kriesten/.m2/repository/joda-time/joda-time/2.0/joda-time-2.0.jar(or g/joda/time/base/AbstractInstant.class)
> > > [ERROR] .../Converter.scala:20: error: org.joda.time.DateTime does not
> > > have a constructor
> > > [INFO]     new DateTime( date )
> > > [INFO]     ^
> > > [ERROR] three errors found
>
> > > This works fine withjodatime 1.6.2. I double checked the 2.0 jar is
> > > ok, also, the files can be decompiled fine using jad.
>
> > > Any hint what might go wrong here?
>
> > > Best regards, --- Jan.

Jason Zaugg
Joined: 2009-05-18,
User offline. Last seen 38 weeks 5 days ago.
Re: Re: joda time 2.0

Add this JAR to your classpath:

org.joda
joda-convert
1.1

-jason

On Sun, Aug 14, 2011 at 10:01 AM, Tim P wrote:
> Has anyone any suggests as to what I can do about this as a user?
> I'm compiling within intellij using the scala module.
>
> The problem is that I get this;
>  error while loading Period, Missing dependency 'class
> org.joda.convert.FromString', required by C:\programmingExperiments
> \joda-time-2.0\joda-time-2.0.jar(org/joda/time/Period.class)
>
> repeated for each of the types at the top of the Make error list. It
> doesn't tell me which or what I need to modify in order to make it go
> away.
> Does this mean I simply can't make it compile, or do I have to go
> around importing org.joda.time.convert._into every scala file that
> requires it?
>
> Has anybody any interest in sorting this out? Or are you just going to
> blame each other? Right now it looks like I've got to go back to a
> previous version of jodatime, which is a shame because I do use joda
> everywhere.
>
> Tim
>
> On Aug 6, 12:18 pm, JodaStephen wrote:
>> This library dependency should be optional. Annotations in Java are
>> optional - if they aren't found, the class still loads and runs.
>> Clearly Scala isn't respecting that.
>>
>> I only included this inJoda-Time because of how Java annotations are
>> optional. No one should be forced to pick this up this as a
>> dependency. Can Scala be changed/fixed?
>>
>> Stephen
>>
>> On Aug 5, 8:18 am, Jason Zaugg wrote:
>>
>>
>>
>>
>>
>>
>>
>> > You need to explicitly include 'joda-convert', which is marked as a
>> > optional dependency in thejoda-time POM [1]
>>
>> >
>> >   org.joda
>> >   joda-convert
>> >   1.1
>> >
>>
>> > The Scala compiler requires that all classes referenced in signatures
>> > of classes that you use are also available on the compile time
>> > classpath.
>>
>> > -jason
>>
>> > [1]http://search.maven.org/remotecontent?filepath=joda-time/joda-time/2....
>>
>> > On Fri, Aug 5, 2011 at 9:09 AM, Jan Kriesten wrote:
>>
>> > > Hi,
>>
>> > > I just tried to usejodatime 2.0 (from the maven repo) with scala
>> > > 2.9.0-1. It seems that the compiler can't analyze the lib:
>>
>> > > [INFO] ...: info: compiling
>> > > [INFO] Compiling 3 source files to .../target/classes at 1312527976035
>> > > [ERROR] error: error while loading DateTime, Missing dependency 'class
>> > > org.joda.convert.FromString', required by
>> > > /Users/kriesten/.m2/repository/joda-time/joda-time/2.0/joda-time-2.0.jar(or g/joda/time/DateTime.class)
>> > > [ERROR] error: error while loading AbstractInstant, Missing dependency
>> > > 'class org.joda.convert.ToString', required by
>> > > /Users/kriesten/.m2/repository/joda-time/joda-time/2.0/joda-time-2.0.jar(or g/joda/time/base/AbstractInstant.class)
>> > > [ERROR] .../Converter.scala:20: error: org.joda.time.DateTime does not
>> > > have a constructor
>> > > [INFO]     new DateTime( date )
>> > > [INFO]     ^
>> > > [ERROR] three errors found
>>
>> > > This works fine withjodatime 1.6.2. I double checked the 2.0 jar is
>> > > ok, also, the files can be decompiled fine using jad.
>>
>> > > Any hint what might go wrong here?
>>
>> > > Best regards, --- Jan.

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