Designer problems with org.joda.time.*

I’m having trouble using org.joda.time.* with Designer->Rules.

If I try to use any of the org.joda.time.* classes, like this:
var DateTime dt

I get a error in the Designer UI like this:
Couldn’t resolve reference to JvmType ‘DateTime’.

Starting from the ground up, I checked my import statement and it doesn’t give me any UI errors:
import org.joda.time.*
I’m suspecting I may need to take action to add the joda.time jar to the classpath, but can’t find any option in the designer UI to add a library?

Do I need to specifically add the joda.time jar? Or does the Designer automatically do that when I use the import statement?

Here’s my simplest rules file ever, and the last line gives me the UI error “Couldn’t resolve reference to JvmType ‘DateTime’”. I’m probably missing something blatantly obvious, I’d appreciate any pointers.

// import the decimal type as we refer to it in a rule
import org.openhab.core.library.types.DecimalType
import org.openhab.core.library.types.*
import org.openhab.core.persistence.*
import org.openhab.model.script.actions.*
import java.lang.String
import java.lang.Integer
import org.joda.time.*

var Number counter
var DateTime dt

You do not need to add joda to the classpath. It is already part of the classpath by default.

There might be some ambiguity caused by one of the other imports having a DateTime. Try

var org.joda.time.DateTime dt

I see nothing different from what I do in my rules to explain the error.

What version of Designer are you using?

I’m using Designer 1.8.2

I managed to fix the problem by deleting the rules file and starting over.