java.lang.ClassNotFoundException: org.jfree.chart.plot.PlotOrientation - java

I have a problem when I try to run my project
The exception is :
java.lang.ClassNotFoundException: org.jfree.chart.plot.PlotOrientation
I have added these libs to my project and to my classpath
commons-beanutils-1.8.0
commons-collections-2.1.1
commons-digester-1.7
commons-javaflow-20060411
commons-logging-1.0.4
groovy-all-1.8.6
iText-2.1.7
jasperreports-5.2.0
jcommon-1.0.17
jfreechart-1.0.13
I follow some solution to this website but I still have the Exception...
I have this problem since 2 days and I never get solutions and now I really need help.
Thanks!!!

If you're using a dependency manager (Maven, SBT, Ivy, Gradle, etc.) copy and paste the respective snippet above into your project file. If you're using a dependency manager, that's all there is to resolving this exception.
https://repo1.maven.org/maven2/info/novatec/testit/livingdoc-confluence5-plugin/1.1.2/livingdoc-confluence5-plugin-1.1.2.jar

All of the following jars/dependencies, contain a class with the same name as your missing class. Add the correct jar/dependency (preferably the one relevant to your project), to the classpath of your project, and you should no longer receive the error.
You can download the JAR directly, or configure a build tool to do your dependency management for you. (e.g. ivy+ant, gradle, maven, etc)
Additionally, this link provides instructions on manually adding a JAR to your classpath.
Ask if you need more help with this.

Related

How do I use another java project in my code?

I am currently using the Eclipse IDE and want to import an external java project so that I can use it in something I am working on. I downloaded the directory of icePDF, found here, and would like to use the java class file "SwingViewBuilder.java" that is found in the directory I linked at "/icepdf/branches/icepdf-6.2.5/icepdf/viewer/src/org/icepdf/ri/common". I have tried some basic things like importing the folder itself, but it did not work.
I would highly suggest using a dependency management tool like Maven or Gradle to download this dependency and any other dependencies you may have into your project for you.
Here is the maven getting started guide: https://maven.apache.org/guides/getting-started/
And here is the maven dependency for you to add to your pom.xml file: https://mvnrepository.com/artifact/org.icepdf.os/icepdf-viewer/6.2.2
If you specifically need version 6.2.5, you will need to build the icePDF project yourself and configure your class path to use it as a dependency.

Getting Error java.util.zip.ZipException: duplicate entry: classes/META-INF/MANIFEST.MF When Deploying Application using JMod Plugin

Im using OpenJDK9 and created a parent child structure to deploy the app using JLink and JMod.
I follow the jigsaw example on Internet to create my structure of App. Before I was getting path must be directory when using JMod 3.0.0-alpha-1, then i find its a bug in Plugin, 3.0.0-alpha-2-SNAPSHOT was not available yet so i build it, the path errors gone but I'm getting new error.
These error cause by the dependencies i have added in POM file, If i comment the dependencies the project build successfully, but i want to build the project with these dependencies.
Caused by: java.util.zip.ZipException: duplicate entry: classes/META-INF/MANIFEST.MF
I have uploaded the project on git also Sample Project on GitHub
This is caused because one or more of your dependency have ZipException class. it a conflict in class import. You should try removing all the imports and adding it one by one.
You get this error because you have one or more similar classes on your classpath. These classes come from dependencies defined in the pom.xml file.
Suggested solution:
First, use this plugin to check duplications in your classpath.
Then remove unnecessary dependencies from your pom.xml OR exclude classes or jar files. This documentation can help you.
Hope that this will help you.

Elasticsearch without Maven

Recently I have begun working on a Java Spring project that does not use Maven and I need to build elasticsearch functionality into the program but I cannot find any information about how to import elasticsearch without the use of Maven.
Has anyone ever had to do something similar?
Is it maybe possible to just use Maven on this one part of the project?
Thank you for any help.
Maven just provide you a way to manage your dependencies. So, if you manage your dependencies in directly downloading JARs, you just have to download all the dependencies you needs and include them in your classpath.
As #Camille Gerin-Roze said , all you need is to download the ElasticSearch dependencies and add them to the classpath.
A place to start is :
https://mvnrepository.com/artifact/org.elasticsearch/elasticsearch/2.3.5
And using the "Download Jar" link
If you scroll down and read the part that says "Compile Dependencies (32)" , it will tell you what other dependencies you need to download manually and add to the class path.
Please note that each of these dependencies may or may not have co dependencies that you may need to download and add to the classpath as well.

Hibernate Validator: Must I use Maven?

From hibernate.org: http://hibernate.org/validator/documentation/getting-started/
I saw Prerequisites:
Java Runtime >= 6,
Apache Maven
However, "maven" is not even mentioned in the following:
http://www.aviyehuda.com/blog/2010/04/14/using-hibernate-validator-to-cover-your-validation-needs/
Our current project is not maven-based, a student project. Could we still use hibernate validator without using maven? Or is there any better choice for hibernate validation?
Maven is not required. The main reason you want to use Maven is that it makes downloading all the package dependencies super easy.
If it's just a small student project, and you don't want to use Maven, then just download the jars that you would otherwise have downloaded with Maven.
You can manually download the jar files here : http://hibernate.org/orm/downloads/
Maven is optional. But it's a very helpful tool for building Java projects (via many phases like compile, test, package, install...). You'd better learn to use it.
In your question, the hibernate-validator jar will depend on other jars such as hibernate-jpa, validation-api, joda-time...
It means you can not run your project with only hibernate-validator jar file. You need to collect all the required jars together.
Maven will automatically resolve it for you.
You can download from:
https://repo1.maven.org/maven2/org/hibernate/hibernate-validator/5.2.4.Final/hibernate-validator-5.2.4.Final.jar
Then add this file jar to your project manually. As you seen, downloading jar file is an alternative way when not using Maven.

Implementing Maven for an existing project

I have a project implemented in ADF.
I need to build it using Maven now.
I wrote the POM but now stuck at adding dependancies.
There are way too many JAR files, specifically about ADF, Toplink etc which I believe I will need to put in my POM.
Now, only way till now i could figure out is to go to each JAR, open manifest file, get version etc, and then get the dependancy block from maven online repository.
Is there a diff and easier and faster way of doing it.
Please help!!
Note: Chances are high that my question may sound illogical or stupid cause I have been using maven only for a week now.
-Santosh
If you are using a decend IDE, it could resolve your dependencies for you. If it can't import a class, you can ask it to look up the class in the Maven repository. Then you can choose which dependency to add to your pom.xml.

Categories

Resources