如何为我自己的项目正确导入 commons.apache.math 库 [英] how to import correctly the commons.apache.math libraries for my own project

查看:34
本文介绍了如何为我自己的项目正确导入 commons.apache.math 库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我自己的项目中使用 commons.apache.maths 类,但我不知道如何将它们正确导入到 eclipse 中.我已经访问了上述包的下载页面 http://commons.apache.org/math/download_math.cgi 但我不知道我要导入的 jar 文件是在二进制 zip 文件还是源 zip 文件中.我首先尝试了二进制文件,当我进行导入时,我只会得到一个空包列表.知道如何正确导入的人可以告诉我如何做吗?

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?

我现在正在从上面的链接下载 zip 文件,将其解压缩,然后右键单击我的项目-> 属性-> Java 构建路径-> 库-> 添加外部罐子.我的问题是我不知道要添加哪些罐子.

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.

提前致谢.阿林德.

推荐答案

需要这样导入.

import org.apache.commons.math

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

You can add the zip file in your build path or extract the jar files from the zip and add it to the build path. For example to add 2.1 of apache math you need this zip file commons-math-2.1.zip or extract commons-math-2.1.jar from the zip file and add it to your eclipse build path.

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

Another trick is - if you have the jar files or zip file added in your build path in eclipse then do ctrl+shift+o and eclipse will automatically import the packages for you.

这篇关于如何为我自己的项目正确导入 commons.apache.math 库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆