Attempting to import class from a non-standard location [interop]

212 views
Skip to first unread message

John Bohn

unread,
Nov 30, 2014, 2:49:40 PM11/30/14
to clo...@googlegroups.com
Hi all,
I'm trying to import a class from a non-standard location.. Specifically, I'm trying to import PhoneNumberToCarrierMapper from libphonenumber and am receiving the following error:

Exception in thread "main" java.lang.ClassNotFoundException: com.google.i18n.phonenumbers.PhoneNumberToCarrierMapper, compiling:(phonelib/shared.clj:1:1)

https://github.com/jjbohn/libphonenumber/blob/master/java/carrier/src/com/google/i18n/phonenumbers/PhoneNumberToCarrierMapper.java

(ns phonelib.shared
 
(:require [clojure.string :refer [lower-case]])
 
(:import  [com.google.i18n.phonenumbers PhoneNumberUtil
                                         
PhoneNumberUtil$PhoneNumberFormat
                                         
PhoneNumberToCarrierMapper]))

My assumption is the problem has to do with how the directories are structured in this library (https://github.com/jjbohn/libphonenumber/tree/master/java). 

Anyone run into this before and know of a workaround? 

Steven Yi

unread,
Nov 30, 2014, 8:24:18 PM11/30/14
to clo...@googlegroups.com
Hi John,

Could this maybe just be a dependencies problem?  It seems you're trying to use classes from two different libraries:

com.googlecode.libphonenumber/libphonenumber
com.googlecode.libphonenumber/carrier

If checking the dependencies for your build doesn't solve it, could you explain a little further what build system you are using?

steven

John Bohn

unread,
Dec 1, 2014, 10:01:11 AM12/1/14
to clo...@googlegroups.com
Ah perfect! Thanks Steven. That works great. Simple mistake on my part. 
Reply all
Reply to author
Forward
0 new messages