简体   繁体   English

如何从该库,NetBeans,Java导入

[英]How to import from this library, NetBeans, Java

I'm trying to import the BigDecimalMath class into my current project. 我正在尝试将BigDecimalMath类导入到我的当前项目中。 I created a new library by going to Tools -> Libraries -> New Library. 我通过转到工具->库->新库创建了一个新库。 I called the library BigDecimalMath, as you can see below. 我叫库BigDecimalMath,如下所示。 I added a new JAR/Folder and then selected the download from Cornell's website, here . 我添加了一个新的JAR / Folder,然后从Cornell的网站( 此处)选择了下载。 Direct download . 直接下载

图书馆截图

I'm unsure of how to import it into my class now. 我不确定现在如何将其导入班级。 This library is part of my current project. 该库是我当前项目的一部分。 I've tried import org.nevec.rjm and some other things, but I think I'm doing something wrong. 我已经尝试import org.nevec.rjm和其他一些东西,但是我认为我做错了什么。 Any advice appreciated. 任何建议表示赞赏。 Thanks! 谢谢!

You appear to have a source version of that library. 您似乎拥有该库的源版本。 Your window displays a jar containing org.nevec.rjm.BigDecimalMath.java . 您的窗口将显示一个包含org.nevec.rjm.BigDecimalMath.java的jar。 I think you need to download a binary version of the jar and add that to your class-path. 我认为您需要下载jar的二进制版本,并将其添加到类路径中。 Then you would import that one class with, 然后,您可以使用

import org.nevec.rjm.BigDecimalMath;

or the entire package with, 或整个包装,

import org.nevec.rjm.*;

Alternatively, you might be able to build the library from your src jar. 另外,您也许可以从src jar中构建库。

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

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