The Apache Software Foundation is an American non-profit corporation that supports open source software projects written by volunteers. It includes a vast number of projects in widely diverse fields (see https://en.wikipedia.org/wiki/List_of_Apache_Software_Foundation_projects). One part of this collection is called Apache Commons, consisting of various Java libraries. These can be downloaded from http://commons.apache.org/downloads/.
We used the Apache Commons Math Library in Chapter 6, Regression Analysis. Here are the steps to follow to use it in your NetBeans projects:
tar.gz
file or the .zip
file of the most recent version (3.6.1, as of August, 2017) of the commons-math archive file from: http://commons.apache.org/proper/commons-math/download_math.cgi.Library/Java/Extensions
).Apache Commons Math
for the Library Name (see Figure A-32), and click OK. This adds that library name to your NetBeans Libraries list.Figure A-32. Creating a new library in NetBeans
commons-math3-3.6.1.jar
file inside that folder (see Figure A-33) and click on the Add JAR/Folder button.Figure A-33. Locating the JAR file for a NetBeans library
commons-math3-3.6.1-javadoc.jar
file from that same folder.Figure A-34. Adding the Apache Commons Math Library to a specific NetBeans project
To test your installation, do this:
SummaryStatistics stats;
SummaryStatistics
class is not part of the standard Java API, NetBeans will mark that line as erroneous, like this:Figure A-35. Adding the correct import statement in NetBeans
Figure A-36. Getting the import statement inserted automatically in NetBeans
SummaryStatistics
class name where the stats
variable is being declared, and then select Show Javadoc from the drop-down menu that appears. That should bring up the Javadoc page for that class in your default web browser.Figure A-37. Surveying the other Javadocs in a library