How to use this library with Eclipse - java

I'm trying to use this library https://github.com/axet/vget
I can't seem to figure out how to get a .jar file out of that so I can use it.

Well, you can put the below dependency in your pom.xml if you use Maven.
<dependency>
<groupId>com.github.axet</groupId>
<artifactId>vget</artifactId>
<version>1.1.5</version>
</dependency>
Otherwise, you could download the archive from https://github.com/axet/vget/releases and build it yourself.
If you want the latest (unreleased) version, you'll have to clone the repository on your machine and build it yourself.

Related

How to connect Java Applocation to JIRA?

I want my java application to communicate with JIRA how can i achieve this functinality. I mean what configuratons are need to add, what are jar files etc ?
You actually don't need Jar files if your java project is using Maven. Just add maven dependency
<dependency>
<groupId>com.atlassian.jira</groupId>
<artifactId>jira-api</artifactId>
<version>${atlassian.product.version}</version>
<scope>provided</scope>
</dependency>
If you are not using maven as build system to your project. Download jar from maven directly and add it to your project.
Follow the documentation https://developer.atlassian.com/server/jira/platform/java-apis/ and start development

how to determine dependencies

I'm currently learning java and want to create a project, using maven, hibernate and MySQL. I know that in order to use any of the artifacts with maven, I should find it on mvnrepository and add it to pom.xml. The question is where can I get the list of mandatory dependencies for each artifact I use, f.ex if I need hibernate, I found hibernate-core 4.3.8.Final, proceed to this link and can see it's dependencies in section "depends on". Should I add all of them into pom.xml also?
Well, I think you know about maven.
And yes, You should include all the dependencies with version on your pom.xml files (Which is the main file for all your dependencies ).
First, you need to identify all required dependencies and add on pom file.
While executing code, It primarily tries to get that dependency from local repository (.m2) And if it doesn't exists then it downloads from it's web repository.
Link: maven setup
How it works??
Suppose, You are using log4j for loggin.
You need to know the log4j Maven coordinates,
for example
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
It will download the log4j version 1.2.14 library automatically. If the “version” tag is ignored, it will upgrade the library automatically when there is a newer version.
Declares Maven coordinates into pom.xml file.
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
</dependencies>
When Maven is compiling or building, the log4j jar will be downloaded automatically and put it into your Maven local repository.
All manages by Maven.
How to find the Maven coordinates?
Visit this Maven center repository, search the jar you want to download.
Hope, It will help.
Thanks.

How to get started with RxJava

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

How to make jar of a Project dependent on another jar

I want to package my files into jar,but these are dependent on Apache HttpClient jars. So is there any way to package all into single jar ??
You can put the dependency jars into your project's jar. Here is some info.
You can use a build tool like Maven to manage project dependencies easily. If you are using eclipse all you need to do is to install maven plugin and than you can create maven projects(or you can also convert your existing one).
After creating maven project you can manage dependencies by making entry into the pom.xml file.
You can do something like this :
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.3.2</version>
</dependency>

Maven Java project in eclipse and mongodb libraries

I have a Maven project in Java. I am new to all of these concepts. I created a Restful project which works well with a file repository. But I want to change that to a mongo repository.
So I added my repository class, then I need to add the mongo libraries. I right click on the project and select Maven --> Update, but the libraries are not being downloaded. So I add them myself via Project Build path and this makes my project to compile.
However at runtime I get the exception of classNotFound for mongo classes.
I read some posts and added these line to pom.xml:
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>1.3</version>
</dependency>
Still not compiling. How should I add the libraries in a way that it compiles and also at runtime my program can find those classes?
Where did you get 1.3 for a version? The latest is 2.12.1.

Categories

Resources