ReactiveX / RxScala

RxScala – Reactive Extensions for Scala – a library for composing asynchronous and event-based programs using observable sequences
Apache License 2.0
888 stars 110 forks source link

Caused by: java.lang.ClassNotFoundException: rx.functions.Func1 #173

Closed asethia closed 9 years ago

asethia commented 9 years ago

Hi,

I am trying to run simple hello example

import rx.lang.scala. import scala.concurrent.duration. import scala.language.postfixOps

object HelloWorldObservable extends App{

override def main(args: Array[String]) { val ticks:Observable[Long]=Observable.interval(1 seconds) val evens:Observable[Long]=ticks.filter(%2==0) val bufs:Observable[Seq[Long]]=evens.slidingBuffer(count=2, skip=1) val s=bufs.subscribe(println()) readLine() s.unsubscribe() } }

I am getting following error

Caused by: java.lang.ClassNotFoundException: rx.functions.Func1 at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 2 more

It is using rxscala_2.11.

Please let me know what is missing.

Regards, Arun

asethia commented 9 years ago

Scala version 2.11.5

samuelgruetter commented 9 years ago

What command did you use to run it? You probably miss the RxJava JAR on the classpath.

asethia commented 9 years ago

yes I able to fix by adding rxjava-1.0.12.jar

thanks a lot.