Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Register rxJava in Eclipse(io.reactivex)
Register rxJava in Eclipse [message #1785691] Wed, 18 April 2018 11:57 Go to next message
Magnus Magnussson is currently offline Magnus MagnusssonFriend
Messages: 1
Registered: April 2018
Junior Member
Hi All!


Im trying to add the RXJava (io.reactivex.Observable) librarie into Eclipse but with no success.
First i added a file called rxjava-2.1.12.jar then i added the rxjava-2.1.12.zip.
Eclipse seems to accept those files.
I can browse them and it seems to be the right librarie
No error until i run the program.

import java.io.IOException;
import io.reactivex.Observable;
public class Start {
public static void main(String[] args) {
System.out.println("Hej");
Observable.fromArray(0,1,2,3,4,5).subscribe( (t) ->
System.out.println(t ) );
try {
System.in.read();
}catch (IOException e) {
e.printStackTrace();
}
}
}


This error pops up:
Exception in thread "main" java.lang.NoClassDefFoundError: org/reactivestreams/Publisher
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
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)
at Start.main(Start.java:13)
Caused by: java.lang.ClassNotFoundException: org.reactivestreams.Publisher
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)
... 13 more

I have googled this and 1 suggestion is to alter text in a gradle file.
Its shouldnt be that complicated.
Seems like the editor is satisfied but the runtime isnt.

Please help me.

//Magnus
Re: Register rxJava in Eclipse [message #1785722 is a reply to message #1785691] Wed, 18 April 2018 22:22 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 3159
Registered: July 2009
Senior Member

Are you actually using Gradle? If so, do you have Buildship installed and enabled on the project? If not, exactly what do you mean by "add" when it comes to the library?

Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:Automating the creation of HMI with Eclipse RCP
Next Topic:Eclipse Hot Swapping Doesn't Work
Goto Forum:
  


Current Time: Fri May 25 20:41:22 GMT 2018

Powered by FUDForum. Page generated in 0.02927 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top