I'm trying to embed Jetty 9 in my project, and the tutorial at http://www.eclipse.org/jetty/documentation/current/advanced-embedding.html#jetty-helloworld suggests I need a file called "jetty-all.jar", but I can't seem to find this in the download distribution. Where do I get it from? I'm not using maven.
I found it in maven repo with a different version:
http://repo1.maven.org/maven2/org/eclipse/jetty/aggregate/jetty-all/9.0.4.v20130625/jetty-all-9.0.4.v20130625.jar
The Search Engine for The Central Repository may helps you find jar files even you don't use maven
Related
I need to do Amazon PA API Migration on March.
I'm trying to find a Maven public repository where is published the 'PA API 5.0 sdk'.
This is the official documentation : link
It says :
Download paapi5-java-sdk-and-samples archive and unzip it.
Open the project in any editor of your preference.
Add all jars present in dependencies folder to the build path.
It's not professional and not maintainable doing like this..
Also many of these jars are old versions (2016 like).
I've tried to contact AWS PA API support but I've got generic response (read documentation etc.)
Suggestions? Do you know Java unofficial libraries? Thanks
Same here. There is only an old maven sdk available. I cannot even import correctly the jar on intellij idea. The IDE is able to find alle the classes needed by the examples, but on building it says: "error: package com.amazon.paapi5.v1 does not exist". I added the jar with this procedure
I have the same problem and totally agree that it's not professional and not maintainable at all.
My current workaround is just to integrate manually the paapi5-java-sdk-1.0.0.jar and then figure out what other dependencies were missing, and which one I don't need (for example junit-4.12.jar does not make not much sense for me when I just want to use it in production).
You might already having some dependencies in place that you don't need to add. For example you might already have Jackson. So don't add this to your pom.
All other dependencies that you need, instead of using the jar files, just add the offical repo of them to your pom as usual with the same version as you find in the zip file. That way you have the least manual dependencies as currently possible and are sure all additional dependencies work fine with the Amazon SDK.
In my case I just had to add okhttp, okio, gson, gson-fire and threetenbp from the offical repo.
You can use mvn install to install downloaded jar into your local repository. See here
https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
This question already has answers here:
How to include libraries in Java without using an IDE
(6 answers)
Closed 8 years ago.
I'm trying to use a java lib to connect to a database, im doing the tutorial outlined here, http://www.homeandlearn.co.uk/java/connect_to_a_database_using_java_code.html
and I can get it to work in netbeans by putting the .jar into the library file in my project file but I don't have a clue how to get it to work hen using an ide such as vim. can someone help?
If I got your question right, you can find the right answer on this other StackOverflow post: how to include libraries in java without using an IDE
You need to build both files into a JAR file, then you can run it.
I hope this helps.
A build tool which features dependency management such as Maven will help solve this problem. To use Maven you will add the location of libraries you require to an XML file (pom.xml) and Maven will download them for you and incorporate them in your target application archive (e.g. a war file).
Maven central provides a means to search for dependencies. In your case you can find the Derby client jar here. Click on the version of the library you would like to use and you'll see the sections of build descriptor code you needs to copy and paste in for: Maven, Ivy, and a few other popular build/dependency management tools.
Once you are comfortable with Maven, you could look up the Maven "Shade" plugin which will help you create a single jar file containing the necessary dependencies to run your application.
Vim, is more of an editor than an IDE, so you will need to specify the library .jar files manually on your class path when running your application.
You can do this by specifying the -cp parameter to the Java executable. e.g.
java -cp driver.jar MyMainClass
The way you are trying to use the library you desired requires manually adjusting your CLASSPATH. Oracle has some detailed instructions on that: PATH and CLASSPATH.
Though, I would suggest to use some kind of build tool which makes it easier to handle your applications dependencies.
In the Java world, the most convenient tools are Ant, Maven and Gradle.
I feel you have just started Java development, so I would prefer Gradle in your case, although Maven is still pretty widely used in projects.
With these build tools handling dependencies will not be -lets say- wired in the IDE and you can easily build your application in any environment.
I am new to java web development and the book I am using to learn uses Maven and Tomcat for development. After searching some basics about Maven on internet all I know is that it is a tool for managing dependencies in project. I am using Netbeans 8 and every time I create a new project or clean-build an existing project Maven downloads lots of files. Is there any way I can keep a common place/repository for all my Maven projects which can be used locally? I have gone through some existing answers on stackoverflow but for me as a beginner they are difficult to understand.
Maven indeed has such a local repository (in .m2/repository in your home folder) where the files found to be needed are downloaded are automatically stored for future use.
The source repository - Maven Central - is very large, so you do not want to download everything as you will most likely not need most of it.
If you need to go offline, or want to be sure that everything you may need in your current build, you can run the dependency:go-offline target. You can then safely use the -o switch to maven to avoid network usage.
When you create a Maven project and build it for the first time, Maven will automatically create a local repository for you, downloading the necessary jars for your project to this location. From then on, all your maven projects will share this repository.
On Windows, the default location for your local Maven repository is
%HOMEPATH%\ .m2\repository
You will find this page useful: http://maven.apache.org/guides/mini/guide-configuring-maven.html
You can also download 'Maven the complete reference' for free as a PDF from here: http://www.sonatype.com/resources/books/maven-the-complete-reference/download
I am using the last version of Modbus4J 2.0.2, converted to use Maven for dependency management.
In my first Modbus4J project (1 year ago), I only add the different *.jar to my project and it works fine. (modbus4J.jar, seroUtils.jar, RXTXcomm.jar)
But now I can not do it, if I add the new jar on my project I can see a lot of build errors, regarding for apache libs...
I am using Eclipse and I installed the maven plugin but I do not know how I can insert the libraries in my project.
Do you know How Can I build and test the files of com.serotonin.modbus4j.test of Modbus4J 2.0.2? (MasterTest.java, ListenerTest.java...)
And How Can I integrate the new Modbus4J libraries on my project?
The library is here:
https://github.com/infiniteautomation/modbus4j
Thanks in advance,
Best regards.
Look at the pom.xml file in the modbus4j project. You'll see that it declares a local file based repository (modbus4j-local). That is where the serotonin-timer & serotonin-utils dependencies are stored.
If that doesn't help you, then it's not clear what you are trying to do. Consider posting your project's pom.xml file contents and/or the important build error messages you are seeing.
Where can I find the jar file or the source code of JEE6? Or is there another way how you can get autocompletion for this in Netbeans/Eclipse?
And I have just installed glassfish so that i can use JAX-RS but i do not understand how it works. Why does the javacompiler find these classes but netbeans does not? I building with maven2 but have not set any paths or so.
And why am I not able to install JEE6 without glassfish? I just do not need an application server for a REST service with Jersey.
Best regards,
CQQL
Question #1:
See this example project.
The example project is built with maven, which may answer your question about auto-complete. Netbeans 6.8+ (approx) has built-in maven support. After the first build of the example project, I think you'll see that auto-complete works better for any dependencies (i.e. jersey) inside the pom.xml. In my Netbeans, auto-complete works, but the javadocs are not there, which may mean that Jersey wasn't bundled with them.
Question #2: Your maven on the command line and the one inside Netbeans are different copies. You can make Netbeans use a specific copy of maven in Tools/Options/Misc/Maven/External Maven Home. This may clear up some confusion.
Question #3: Jersey can run in Tomcat or Jetty if you find Glassfish to be too much app server for your needs.