开发者

How to correctly import from apache commons in Java

First of all, forgive my poor programming skills.

I recently downloaded commons math 2.2, which 开发者_运维知识库came with 3 .jar files: commons-math-2.2-javadoc.jar commons-math-2.2-sources.jar commons-math-2.2.jar

I want to use the normal distribution methods but I don't know how to get access to them. http://commons.apache.org/math/api-2.1/index.html

I'm using drJava on mac. What import or package statements do I need? Do I need to change anything in the drJava preferences? Any insight would be greatly appreciated. Thanks


  • add the commons-math-2.2.jar to the classpath
  • import whichever class you need: import org.apache.commons.math.* (avoid the star though - list all the classes the you import. A good IDE should offer you to organize your imports)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜