how to import correctly the commons.apache.math libraries for my own project

Jet*_*nor 8 java eclipse import jar apache-commons

I want to use the commons.apache.maths classes for my own project but I don't know how to correctly import them into eclipse. I have visited the download page for the package mentioned above http://commons.apache.org/math/download_math.cgi but I don't know if the jar file which i want to import is on the binaries zip files or the source zip files. I tried the binaries ones first and when I do the import i just get a list of empty packages. Could somebody who knows how to do a correct import please show me how to do it?

What i am doing at the moment i am downloading the zip file from the link above, extracting it and than right-click my project->properties->Java Build Path->Libraries->Add External Jars. My issue is i don't know which jars to add.

Thanks in advance. Arlind.

Coo*_*ans 9

你需要以这种方式导入.

import org.apache.commons.math
Run Code Online (Sandbox Code Playgroud)

您可以在构建路径中添加zip文件,或从zip中提取jar文件并将其添加到构建路径.例如,要添加2.1的apache数学,你需要这个zip文件commons-math-2.1.zip或从zip文件中提取commons-math-2.1.jar并将其添加到你的eclipse构建路径中.

另一个技巧是 - 如果你在eclipse中的构建路径中添加了jar文件或zip文件,那么执行ctrl + shift + o,eclipse会自动为你导入包.