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

查看:592
本文介绍了如何为我自己的项目正确导入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构建路径->库->添加外部Jar。我的问题是我不知道要添加哪个罐子。

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.

预先感谢。
Arlind。

Thanks in advance. Arlind.

推荐答案

您需要以这种方式导入。

You need to import this way.

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天全站免登陆