简体   繁体   English

在Netbeans中安装MongoDb驱动程序

[英]Install MongoDb Driver in Netbeans

I have installed the MongoDb Plugin in NetBeans. 我已经在NetBeans中安装了MongoDb插件。

I found the quickstart guide here: http://mongodb.github.io/mongo-java-driver/2.13/getting-started/quick-tour/ 我在这里找到了快速入门指南: http : //mongodb.github.io/mongo-java-driver/2.13/getting-started/quick-tour/

When I try to use the imports NetBeans can not find them. 当我尝试使用导入时,NetBeans找不到它们。 In Visual Studio I would just use the NuGet Package manager. 在Visual Studio中,我只使用NuGet包管理器。 What do I have to do in NetBeans? 在NetBeans中我必须做什么?

The dependencies XML where would that go? XML依赖项将流向何处?

Have you included the external JARs in NetBeans? 您是否在NetBeans中包括了外部JAR?

Hover your mouse pointer over your desired project name, and right-click . 将鼠标指针悬停在所需的项目名称上,然后单击鼠标右键 Select Properties > Libraries (found under Categories section) > Add JAR/Folder . 选择“ Properties > Libraries (found under Categories section) > Add JAR/Folder

From the file chooser, specify the location of the JARs you downloaded, and click on Add . 在文件选择器中,指定下载的JAR的位置,然后单击Add

Close the Properties Dialog Box, and expand the Libraries node under your project. 关闭“属性”对话框,然后展开项目下的“ Libraries节点。 You should be able to see the imported JARs. 您应该能够看到导入的JAR。

Also, if you're downloading the mongodb-driver-3.xxjar file, you also need to download the bson-3.xxjar and mongodb-driver-core-3.xxjar files, and import all three in NetBeans. 另外,如果要下载mongodb-driver-3.xxjar文件,则还需要下载bson-3.xxjarmongodb-driver-core-3.xxjar文件,并将这三个文件都导入NetBeans。

I had the same issue, and had to beat my head over it for a long time. 我遇到了同样的问题,并且不得不为之困扰很长时间。 Hope my experience can help you with your issue. 希望我的经验可以帮助您解决问题。

PS: The version of MongoDB driver you're using is quite outdated, and the usage syntax might be deprecated in future versions. PS:您使用的MongoDB驱动程序版本已经过时,将来的版本中可能不赞成使用语法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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