I have visited the following link:
https://github.com/ReactiveX/RxJava/wiki/Getting-Started
and have tried to get RxJava to work with Eclipse, however even after importing it using Maven it still won't find the Observer and Subscriber objects when trying to import them.
I am not too sure where to go from here as the getting started link doesn't explain it that thoroughly.
I am also learning RxJava now, here is the necessary jar files you need:
If using Maven, add this dependency into pom:xml (replace with latest version available):
<dependency>
<groupId>io.reactivex</groupId>
<artifactId>rxjava</artifactId>
<version>1.0.11</version>
</dependency>
If you don't want to use Maven, I recommend you download the JAR file from Maven Repository:
http://mvnrepository.com/artifact/io.reactivex/rxjava
Regards,
Cristi
Related
This is the first time I have encountered Maven so I don't really know what I'm doing here.
What I'm trying to accomplish is to import the java library Beat Link into my java code using Maven.
Could anyone please provide a simple step by step on how to do this in eclipse?
On maven central you got the maven dependency text -
<dependency>
<groupId>org.deepsymmetry</groupId>
<artifactId>beat-link</artifactId>
<version>0.6.3</version>
</dependency>
Once you create a maven project you should have a pom.xml file.
You need to add this text to the dependencies section of your pom.xml file.
If that doesnt make sense to you, do yourself a favor and read/watch a quick tutorial about using maven on a java project. It's pretty simple once you see how it works.
I am trying to use the javaFXGL library. Which is the java gaming library. I am not sure how to use maven to download the library to eclipse. Does anyone know a step by step way to download this. I need to this get some example code running.
I would be easier to get the help if you add your code in the question along with the problems/errors you are facing. Anyways I would suggest you to first read this and this to understand what is maven and how it works with Eclipse IDE.
After reading the articles you will understand that maven project has pom.xml file which is used for maven settings or you can say for Dependency Management, Build Management, etc.
To add the library you need to add its maven dependency in the pom.xml inside the <dependencies> tag like below:
<!-- https://mvnrepository.com/artifact/com.github.almasb/fxgl -->
<dependency>
<groupId>com.github.almasb</groupId>
<artifactId>fxgl</artifactId>
<version>0.2.9</version>
</dependency>
You can also find other dependencies on www.mvnrepository.com
I'm trying to convert a "classic" JAVA EE project, using IBM websphere 8.0.0.5, into a maven multi module project and facing issues with the IBM dependecies.
We use IBM classes from the following packages:
com.ibm.websphere.asynchbeans
com.ibm.websphere.scheduler
com.ibm.websphere.ce.cm
com.ibm.ws.asynchbeans
com.ibm.ws.util.ThreadPool
To get my local project to be compiled I downloaded the was.installer-8.0.0.pm from IBM and installed it to my maven using
mvn install -f "was.installer-8.0.0.pom" -D serverInstallationFolder="C:\Program Files (x86)\IBM\WebSphere\AppServer"
This step was successfull according to command line output.
I then added the following dependencies to my project as described from IBM:
In parent:
<dependency>
<groupId>com.ibm.tools.target</groupId>
<artifactId>was</artifactId>
<version>8.0.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
In module:
<dependency>
<groupId>com.ibm.tools.target</groupId>
<artifactId>was</artifactId>
</dependency>
But I still can't compile my project as the IBM packages are not found.
Can anyone help me to find and correct a mistake I made?
Edit
After following BevynQ tip from the comments I copied the "was_public.jar" to "was_public-8.0.0.jar" (described at IBM here) and added it to my repository:
mvn install:install-file -Dfile="C:\Program Files (x86)\IBM\WebSphere\AppServer\dev\was_public-8.0.0.jar" -DpomFile="C:\Program Files (x86)\IBM\WebSphere\AppServer\dev\was_public-8.0.0.pom"
I then changed the dependencies to:
<dependency>
<groupId>com.ibm.websphere.appserver</groupId>
<artifactId>was_public</artifactId>
<version>8.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.ibm.websphere.appserver</groupId>
<artifactId>was</artifactId>
</dependency>
This helped to get the compiling errors for the imports to com.ibm.websphere done.
What I now have still open is the packages com.ibm.ws.* package. Anyone have an idea?
Edit 2
I added the following dependency and then I was rid of the com.ibm.ws.* import errors.
<dependency>
<groupId>com.ibm.websphere.ws</groupId>
<artifactId>com.ibm.ws.runtime</artifactId>
<version>1.0.0</version>
</dependency>
But it still does not compile as now indirectly references can not be found (in my case commonj.work.WorkManager). It seems I need to add further .jars for every single thing. Isn't there an easier way to provide all websphere jars at once as descirbe in the above linked tutorial with the com.ibm.toolsdependency (which do not work)?
In general, com.ibm.websphere are public API for use by applications (this is true of the packages you listed above) which is consistent with these being in was_public.jar
However, com.ibm.ws package is generally product internals. May I ask what interface methods you are using from the com.ibm.ws.asynchbeans package? Maybe there is a public API alternative.
Regarding commonj.work, the only place I can find this in the WebSphere Application Server product image is WAS/plugins/com.ibm.ws.prereq.commonj-twm.jar so it looks like you will need to use that to compile against.
Here's the solution so I solved my dependency problems:
I configured the company repository manager (nexus) as a mirror. In this nexus all ibm packages are present. As you can think that solved the main problem.
I then added the following dependencies according to common maven style:
Dependencies in pom.xml (version numbers extracted to properties):
<dependency>
<groupId>com.ibm.websphere.ws</groupId>
<artifactId>com.ibm.ws.runtime</artifactId>
<version>${ibm.ws.runtime.version}</version>
</dependency>
<dependency>
<groupId>com.ibm.ws.prereq</groupId>
<artifactId>commonj-twm</artifactId>
<version>${ibm.ws.prereq.commonj-twm.version}</version>
</dependency>
Sorry I can't provide a "nice" solution that's useable by all people but the answer from njr and the comment from BevynQ helped at lot to get clearer with the problem and helped to solve the problem in a "more manual" way by copying the needed jars by hand.
I was facing this issue as I tried to build a project using Maven version 3.3.9, running on Java version 1.8.0_101, as depicted in the screenshot:
This is how I resolved it: Step 1. Download the commonj.jar from here.
Step 2. Determine which JDK your Maven is using by typing mvn -version in the command prompt.
Step 3. Go to that directory and place the commonj.jar file there in the jre/lib/ext directory, as shown below. Now your project should build in maven without any issues.
I have used elastic search in nodejs. But now for a java app I need elasticsearch. So I read the documentation in elastic search official website. But I cant follow one thing
I have installed Maven plugin in Eclipse.
I have done dependency setup in pom.xml in my project.
<dependencies>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>1.5.0</version>
</dependency>
</dependencies>
But whenever I write below line in java it says cant resolve.
import static org.elasticsearch.node.NodeBuilder.*;
So I'm unable to use elastic search in java.
I have read this as source
https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/index.html
http://java.dzone.com/articles/elasticsearch-java-api
I am not sure what you are doing here, you shouldnt have to download the jar manually and add to eclipse as a project dependency. Please go through this tutorial to understand how maven dependency works. Relevant text below:
Maven connects to remote repositories (or you can set up your own
local repos) and automatically downloads all of the dependencies
needed to build your project. For example, lets say you have a project
that uses Apache's Camel routing tool, version 2.10.6, but a new
version of Camel is released, 2.11.1. Instead of having to go to
Apache's website, download the 2.11.1 distribution and replace 2.10.6
with it, you can just tell Maven to use the new distribution and the
work will be done for you.
Iam trying to implement JMS using eclipse.But when I tried to save the code, it showed that javax.jms.* cannot be resolved and there are no suggestions as well recommended by it.
How can I include it and use it? when I googled I found that javax.jms.* is not a part of java API,then how can I use it in eclipse and get my program run successfully?
I would like to implement JMS with the help of activemq,what all do I need to download and include in code?
Iam a newbie to this JMS, please suggest some references or sample code that can implement JMS using activemq.
When you download the activemq archive file from Internet. Extract this archive: /apache-activemq-x.x.x
cd into this apache... directory.
You will see activemq-all-x.x.x jar file.
Include this in your build path.
This should resolve your issue.
If it is a maven project, add the following dependency to your pom.xml and it should start working as expected.
<dependency>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
<version>1.1</version>
</dependency>
There are actually many ways to fix this. As already stated in the comment you need the Java Enterprise Edition API. Java EE is an abstract specification so what you need is an implementation of the JMS API. Since JMS is part of the Java EE specification the easiest thing is to download a application server such as GlassFish (which is the reference implementation) or JBoss.
I assume you already got the Java compiler so you only need the SDK, not the JDK.
Java EE 6 SDK Update 4 A free integrated development kit used to
build, test, and deploy Java EE 6 applications.
http://www.oracle.com/technetwork/java/javaee/downloads/index.html
Then after you have downloaded GlassFish you will end up with a lot of files that is an implementation of the different Java EE specification API's. You will probably want to download the plugin that I linked to beneath so that you can start, deploy and do many other administration task of your server from Eclipse. I do not use Eclipse so I don't remember if you want this version of Eclipse as well.
http://marketplace.eclipse.org/node/867
At last you want to add GlassFish to your buildpath.
I found this blog post (Scroll to "Create projects in Eclipse") if you are unsure what to add, but there are several blog posts on how to add GlassFish to the build path in Eclipse so I won't list them here.
http://www.webagesolutions.com/knowledgebase/javakb/jkb005/index.html
In addition to the answers already provided, if you are using Maven you can add the following dependency (available from Maven2 Central repo):
<dependency>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</dependency>
When you have downloaded activemq zip file from http://activemq.apache.org then when you extract it, head on to .jar file of activemq(This jar file is required). Now from Eclipse do as follows:
RightClick on Project and go to Properties
Java Build Path tab
Libraries tab
Add External JARs...
Get that .jar file from activemq folder
I fixed this problem by including the dependency of Activemq.
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-all</artifactId>
<version>5.15.0</version>
</dependency>
It can be found in jboss-jms-api.jar
If you are using/Testing ActiveMQ.
Then configure your build path and add external jar activemq-all-.jar. (Path:In )
Clean and Build.
This will helped me , will do same to you as well.
Danke,
Rahul.
If you want to resolve this issue using maven, then the correct maven dependency, available in maven repository, is the following:
<dependency>
<groupId>javax.jms</groupId>
<artifactId>jms-api</artifactId>
<version>1.1-rev-1</version>
</dependency>
See post: The following artifacts could not be resolved: javax.jms:jms:jar:1.1