简体   繁体   中英

can't import a scala class to my java code

I tried to

import com.twitter.finagle.service.RetryPolicy$;

however ant complains that it cannot find symbol . I do have this class in my library:

com/twitter/finagle/service/RetryPolicy$$anon$1.class
com/twitter/finagle/service/RetryPolicy$.class
com/twitter/finagle/service/RetryPolicy$$anonfun$backoffJava$1.class
com/twitter/finagle/service/RetryPolicy.class
com/twitter/finagle/service/RetryPolicy$$anonfun$1.class

I can import the class without the dollar sign though. Is there some scala magic I didn't figure out? Thanks!

import com.twitter.finagle.service.RetryPolicy;

You're sure you're not getting an error because of a dependency RetryPolicy$ needs to resolve?

Can you include the actual error message?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM