You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by flyson <m_...@msn.com> on 2014/12/02 23:59:31 UTC

object xxx is not a member of package com

Hello everyone,

Could anybody tell me how to import and call the 3rd party java classes from
inside spark?
Here's my case:
I have a jar file (the directory layout is com.xxx.yyy.zzz) which contains
some java classes, and I need to call some of them in spark code.
I used the statement "import com.xxx.yyy.zzz._" on top of the impacted spark
file and set the location of the jar file in the CLASSPATH environment, and
use ".sbt/sbt assembly" to build the project. As a result, I got an error
saying "object xxx is not a member of package com".

I thought that this could be related to the dependencies, but couldn't
figure it out. Any suggestion/solution from you would be appreciated!

Thanks!



--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/object-xxx-is-not-a-member-of-package-com-tp20205.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
For additional commands, e-mail: user-help@spark.apache.org


Re: object xxx is not a member of package com

Posted by Prannoy <pr...@sigmoidanalytics.com>.
Hi,

Add the jars in the external library of you related project.

Right click on package or class -> Build Path -> Configure Build Path ->
Java Build Path -> Select the Libraries tab -> Add external library ->
Browse to com.xxx.yyy.zzz._ -> ok
Clean and build your project, most probably you will be able to pull the
classes from com.xxx.yyy.zzz._ package.

Thanks.

On Wed, Dec 3, 2014 at 4:29 AM, flyson [via Apache Spark User List] <
ml-node+s1001560n20205h57@n3.nabble.com> wrote:

> Hello everyone,
>
> Could anybody tell me how to import and call the 3rd party java classes
> from inside spark?
> Here's my case:
> I have a jar file (the directory layout is com.xxx.yyy.zzz) which contains
> some java classes, and I need to call some of them in spark code.
> I used the statement "import com.xxx.yyy.zzz._" on top of the impacted
> spark file and set the location of the jar file in the CLASSPATH
> environment, and use ".sbt/sbt assembly" to build the project. As a result,
> I got an error saying "object xxx is not a member of package com".
>
> I thought that this could be related to the dependencies, but couldn't
> figure it out. Any suggestion/solution from you would be appreciated!
>
> Thanks!
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://apache-spark-user-list.1001560.n3.nabble.com/object-xxx-is-not-a-member-of-package-com-tp20205.html
>  To start a new topic under Apache Spark User List, email
> ml-node+s1001560n1h33@n3.nabble.com
> To unsubscribe from Apache Spark User List, click here
> <http://apache-spark-user-list.1001560.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=cHJhbm5veUBzaWdtb2lkYW5hbHl0aWNzLmNvbXwxfC0xNTI2NTg4NjQ2>
> .
> NAML
> <http://apache-spark-user-list.1001560.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/object-xxx-is-not-a-member-of-package-com-tp20205p20288.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.