Remi.b
Remi.b

Reputation: 18239

Failing to import org.apache.commons

First line of MyCode.java is

import org.apache.commons.math3.distribution;

I am trying to compile via the command line with (I am on Mac OS X 10.12.4)

javac -cp "/Users/remi/Downloads/Java/commons-net-3.6/commons-net-3.6.jar"  MyCode.java

(the file really exist and it simply is in my downloads for the moment) but I get the error message

MyCode.java:1: error: package org.apache.commons.math3 does not exist
import org.apache.commons.math3.distribution;
                               ^
1 error

Can you help me out?

Upvotes: 0

Views: 2001

Answers (2)

TuyenNTA
TuyenNTA

Reputation: 1204

You are using the org.apache.commons.math3.distribution so you would need the apache math lib in your classpath. Thanks :)

Upvotes: 1

Carlo S
Carlo S

Reputation: 63

Make sure that the necessary JAR files are included in your build path.

Upvotes: 0

Related Questions