简体   繁体   中英

How to import from this library, NetBeans, Java

I'm trying to import the BigDecimalMath class into my current project. I created a new library by going to Tools -> Libraries -> New Library. I called the library BigDecimalMath, as you can see below. I added a new JAR/Folder and then selected the download from Cornell's website, here . 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. 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 . I think you need to download a binary version of the jar and add that to your class-path. 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.

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