I try to use joda-time library for easier measuring the execution time of my program (not for profiling, just for the user).
But when I compile my project I get error about missing dependency -- the "FromString" class is missing. I tried to explicitly import it, but while typing intellisense (IntelliJ) does not even detect it, on the other hand there is only one jar for download from joda-time site.
How do I resolve this dependency?
I am aware of wrapper for JT but for now I would like to use it directly.
If the problem is with FromString
, then the missing dependency is Joda Convert. Add the relevant jars.
This problem occurs because Scala doesn't implement annotations in the same way as Java. In Java, an annotation that is not found in the classpath is effectively ignored. Thus, loading Joda-Time classes in Java does NOT require Joda-Convert. Since Scala does not load annotations in the same way as Java, Scala users are forced to add the dependency.
来源:https://stackoverflow.com/questions/8368529/how-to-import-fromstring-for-joda-time