error: expected class or object definition

前端 未结 1 527
栀梦
栀梦 2020-12-16 11:14

I have this (smart code):

import com.mongodb.casbah.Imports._
import com.mongodb.casbah.util.bson.conversions._
RegisterJodaTimeConversionHelpers() //error

         


        
相关标签:
1条回答
  • 2020-12-16 11:34

    You have to write this line of code somewhere it can be executed. How about in your main method instead?

    object Main {
      def main(args: Array[String]) {
        RegisterJodaTimeConversionHelpers()
        val connection = MongoConnection()
      }
    }
    
    0 讨论(0)
提交回复
热议问题