简体   繁体   中英

Mongodb java driver error

I am trying to import a few mongodb packages into java. I am using NetBeans as my IDE but I keep getting Package does not exist. I have a mongodb in the Librarians directory. Can some one tell me why this is not working. Ps try look at image bellow if you think there is some details are forgot to mention thanks. `

package nurel;

import com.mongodb.Block;
import com.mongodb.MongoClient;
import com.mongodb.MongoClientURI;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.model.Accumulators;
import com.mongodb.client.model.Aggregates;
import com.mongodb.client.model.Filters;

public class nurel {

}

`

Note: The image refereed to above. image of my desktop screen with NetBeans open showing file structure .

I could reproduce your problem, and it seems you have the incorrect Jar file. You have to import the library, not the javadocs file

Downlad and import this file instead: mongo-java-driver-3.8.0.jar

Evidence:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM