cannot find jars for the imported Giraph packages - eclipse

I was trying to run the SSSP giraph program from Eclipse. But I couldnt get the following packages imported
import org.apache.giraph.graph.BasicVertex;
import org.apache.giraph.graph.BspUtils;
import org.apache.giraph.graph.GiraphJob;
import org.apache.giraph.graph.EdgeListVertex;
import org.apache.giraph.graph.VertexReader;
import org.apache.giraph.graph.VertexWriter;
import org.apache.giraph.lib.TextVertexInputFormat;
import org.apache.giraph.lib.TextVertexInputFormat.TextVertexReader;
import org.apache.giraph.lib.TextVertexOutputFormat;
import org.apache.giraph.lib.TextVertexOutputFormat.TextVertexWriter;
I have followed the instruction in the giraph site to build Giraph and Hadoop.
Which jar should be imported to get the above packages?

Are you running the code for the correct version of Giraph? I think the imports you mention are for versions before 1.0.0, if you include a jar for a newer version it won't find them.

Related

Scala/Spark/Databricks: How to import code from user-created JAR?

I have a JAR that I created with intellij and sbt, that defines a case class and Object. I've uploaded it to my databricks workspace, and attached it to a cluster as a library.
How do I actually import code from it/reference it in my notebook? So far all I can think of is to try
import NameOfJar._
which gives
java.lang.NoClassDefFoundError: DataFrameComparison$
Do I need to have built the jar differently somehow? (Package statement or something?)
you should import import packageName._, jar name is not used in import statement. It should work the same as in usual local java/scala code.
You can check this article for details - https://docs.databricks.com/libraries.html
Btw, does your notebook fail on import itself, or later, when you're trying to use class, that exists inside jar?

Building Hbase on eclipse using Maven (The import org.apache.hadoop.hbase.tmpl cannot be resolved)

I use the maven to import Hbase source on eclipse.
But there has a error that is "The import org.apache.hadoop.hbase.tmpl cannot be resolved)".
I had find the tmpl package , but its "jamon".
How to find the tmpl package, and its "java"?
Can find the tmpl package on Hbase.bin.tar, and import the extend tmpl.jar
It will work.

Scala + Playframework 2.3.X importing dependencies

I am having problems importing two dependencies here is the import
import io.GooglePlayClient
import io.GooglePlayError
and I get this error
object GooglePlayError is not a member of package akka.io
[error] import io.GooglePlayError
object GooglePlayClient is not a member of package akka.io
[error] import io.GooglePlayClient
It seems it is prefixing the package where I am trying to import (akka) to this imports, and the is not able to import.
Thank you
You already have akka.io imported in scope. So, akka.io.GooglePlayError is tried. Instead use import _root_.io.GooglePlayError.
Another option is to import using the fully qualified name of the dependencies if available, that is
import com.yourcompany.io.GooglePlayClient
import com.yourcompany.io.GooglePlayError
If the io package is really a root package, you could consider refactoring your package structure to something like the above.

Import org.junit cannot be resolved

I have a class file beginning with the following in Eclipse:
package org.jsoup.parser;
import org.junit.Assert.*;
import org.junit.Test;
import org.jsoup.nodes.Document;
import org.jsoup.parser.HtmlTreeBuilder;
However, Eclipse indicates an error saying that org.junit cannot be resolved. I have already modified the project properties to include jUnit 3 in the classpath, so wouldn't know what to do further.
Ideas?
EDIT: I have included jUnit 4 as suggested but to no avail...
If you want to use org.junit.Assert you should include JUnit 4. JUnit 3 uses junit.framework.* packages.

Can't find some Akka libs in Eclips

I have recently started exploring Scala.
I have installed Eclips and I integrated Akka-Actors Libs in the Build-Path Project.
But whenever I try compiling the project, I got an erorr. I can't resolve such libraries.
import akka.routing.{Routing, CyclicIterator}
import Routing._
Any idea how to configure Akka to work perfectly with Eclips ?
AFAICT, there's no such class in Akka.
Router, yes - Routing, no.
I have the same problem, I have Added the akka-actor_2.10-2.3.0.jar and the config-1.0.2.jar libraries but the error persists.
In the webpage of akka (akka.io) they use both imports in a example proyect.
http://doc.akka.io/docs/akka/1.3/intro/getting-started-first-scala.html
package akka.tutorial.first.scala
import akka.actor.{Actor, PoisonPill}
import Actor._
import akka.routing.{Routing, CyclicIterator}
import Routing._
.....
.....
....
ANSWER: You should use spray and the spray's library, it has a routing method you can use aswell.
import spray.routing._
You have to download the spray-routing-1.2.0.jar if you want to use it (http://repo.spray.io/io/spray/spray-routing/)