package com.mongodb.client does not exist - java

I am getting error in eclipse console while building application
package com.mongodb.client does not exist.
I am importing two packages :
import com.mongodb.client.AggregateIterable;
import org.bson.Document;

Download the jar files of the packages and add it to the build path of your project.
If you are using maven, add the dependency in pom.xml

Related

Java how to import package project into my project with IntelliJ

I have in the same folder two others folders :
aaa-ui
bbb-features
I'm using IntelliJ how can I add the package (by import) into my ui project ?

JAR Creation Failed in Eclipse

I am using Eclipse Indigo, Jdk and Jre 1.8.
I have errors when creating JAR files like this :
Exported with compile errors: comX/com/abc/component/ext/common/StringUtil.java
Class files on classpath not found or not accessible for: comX/com/abc/component/logging/AsLog$QItem.java
At StringUtil.java I checked there are 2 imports that not resolved
import java.util.Arrays;
import org.apache.log4j.Logger;
--> Still don't know what the solution
And I already make sure that this file is exist: comX/com/abc/component/logging/AsLog$QItem.java
I already Clean and Build Project, but the errors is still.
Here is the JAR File Specification
And I check for this option in JAR Manifest Specification : Use existing manifest from workspace.
Any help will be very appreciated. Thank you.
-xtin-

How do I fully include the Batik library in my Java project?

I am trying to add the Batik library to my Java project. I added the unzipped binary to my lib folder, and added all of the JARs in the top level to the build path.
However, when I make the following import statement:
import org.apache.batik.dom.svg.SAXSVGDocumentFactory; I get the following error:
"The import org.apache.batik.dom.svg.SAXSVGDocumentFactory cannot be resolved"
Other import statements do not exhibit this problem, such as the following:
import org.apache.batik.util.XMLResourceDescriptor;
As far as I understand, the SAXSVGDocumentFactory class exist somewhere in the binary I added to the lib folder, so the issue must be with adding JARs to the build path. How can I make sure that all of the Batik source files are added to the build path correctly and are usable?
It cannot be resolved because it doesn't present in 1.8 jar. It exists in 1.7.
http://www.findjar.com/class/org/apache/batik/dom/svg/SAXSVGDocumentFactory.html
The easy way to find this out is to find the right jar and click to open it by the package: org.apache.batik.dom.svg.SAXSVGDocumentFactory. You wont see this class in 1.8 jar, but you will see it in 1.7 jar.
To fix, download a 1.7 jar and add it to your project again.
http://apache.mirrors.hoobly.com/xmlgraphics/batik/source/
If somebody can't find SAXSVGDocumentFactory after updating Batik in legacy project, just change the import:
import org.apache.batik.dom.svg.SAXSVGDocumentFactory;
with
import org.apache.batik.anim.dom.SAXSVGDocumentFactory;

Trying to import existing Perforce Project in Eclipse

I have imported Perforce Project to my local Drive and then i create workspace in Eclipse Luna, but when i try to import project using File->Import->General->Existing Projects into Workspace then i select root directory of my project. Import wizard scans whole project and then gives me the warning
No projects are found to import. I know the project that i am importing does not have any .classpath and project file. Is there any straight forward way to import the project from Local directory ?
Any help is greatly appreciated.
Import Existing Projects will only import Eclipse projects - which always have a .project file.
To import something else you will first have to create an appropriate project in Eclipse with 'File > New > Project....'. Once you have the project you can use 'File > Import > File System' to import the project files in to your new project.
If it doesn't have .classpath and project files it's not an eclipse project. Import from filesystem.

Issue when import java project

I got a problem when i try to import an java project to Eclipse.
The Eclipse don' build my packages, he construct a directory structure like
com
Test
Test2
Test3
-- and then my .java files
How can I do to import this project with my package ?
I think you need to add a source folder to your project.

Categories