Tak więc próbowałem pracować ze strukturą signal-collect i pobrałem pliki .jar
i wyodrębniono je do folderu. Obecnie struktura folderów wygląda następująco:Dodawanie .jar do classpath (Scala)
LICENSE.txt
PageRank.scala
core-1.1.1-sources.jar
dependencies/
javaapi-1.1.1-sources.jar
NOTICE.txt
README.txt
core-1.1.1.jar
javaapi-1.1.1-javadoc.jar
javaapi-1.1.1.jar
Gdzie PageRank.scala
jest kod testu Scala zapewniają, który jest:
import com.signalcollect._
object PageRank extends App {
val graph = GraphBuilder.build
graph.addVertex(new PageRankVertex(id=1))
graph.addVertex(new PageRankVertex(id=2))
graph.addEdge(new PageRankEdge(sourceId=1, targetId=2))
graph.addEdge(new PageRankEdge(sourceId=2, targetId=1))
graph.execute
graph.foreachVertex(println(_))
graph.shutdown
}
class PageRankVertex(id: Any, dampingFactor: Double=0.85)
extends DataGraphVertex(id=id, state=1-dampingFactor) {
type Signal = Double
def collect(oldState: Double, mostRecentSignals: Iterable[Double]): Double = {
1 - dampingFactor + dampingFactor * mostRecentSignals.sum
}
}
class PageRankEdge(sourceId: Any, targetId: Any)
extends DefaultEdge(sourceId, targetId) {
type SourceVertex = PageRankVertex
def signal(sourceVertex: PageRankVertex) = {
sourceVertex.state * weight/sourceVertex.sumOfOutWeights
}
}
jestem nowicjuszem jeśli chodzi o JVM/Java/Scala, oraz to była moja próba dodania .jar's
do ścieżki klasy do kompilacji PageRank.scala
:
$ scalac -classpath *.jar dependencies/*.jar PageRank.scala
error: IO error while decoding core-1.1.1.jar with UTF-8
Please try specifying another one using the -encoding option
error: IO error while decoding javaapi-1.1.1-javadoc.jar with UTF-8
Please try specifying another one using the -encoding option
error: IO error while decoding javaapi-1.1.1-sources.jar with UTF-8
Please try specifying another one using the -encoding option
error: IO error while decoding javaapi-1.1.1.jar with UTF-8
Please try specifying another one using the -encoding option
error: IO error while decoding dependencies/je-3.2.76.jar with UTF-8
Please try specifying another one using the -encoding option
error: IO error while decoding dependencies/scala-library-2.9.1.jar with UTF-8
Please try specifying another one using the -encoding option
6 errors found
nie mogę dowiedzieć się, co jest nie tak ... co h przyłączyć? Dzięki! Pozdrowienia, -kodowanie
można również użyć ';' oddzielić nazwy jar – Jus12
+1 Dla uzupełnienia należy pamiętać, że należy ** dodać ścieżkę klas zarówno podczas kompilowania, jak i wykonywania **. To jest coś, na co tęskniłem na pierwszy rzut oka. – JoErNanO