Setting up CLASSPATH and ant in Ubuntu

Posted by Dzung Nguyen on Programmers See other posts from Programmers or by Dzung Nguyen
Published on 2013-06-30T22:44:44Z Indexed on 2013/07/01 4:28 UTC
Read the original article Hit count: 371

Filed under:
|

I just started to learn Java using Thinking in Java book, and have some troubles using ant.

I'm using Ubuntu 12.04, and have openjdk 7 java installed. I also setup the CLASSPATH to be the code folder

When I run ant in code folder, this is the output:

Exception in thread "main" java.lang.RuntimeException: JDK 1.4.1 or higher is required to run the examples in this book.
[CheckVersion]  at com.bruceeckel.tools.CheckVersion.main(Unknown Source)

However when I run java -version, this is the output:

java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.5) (6b27-1.12.5-0ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

How to setup ant and classpath correctly?

© Programmers or respective owner

Related posts about java

Related posts about ant