gadgetmo
gadgetmo

Reputation: 3172

Java - ant cannot find rt.jar

I'm compiling DrJava by following these instructions.

But when I run ant jar, I get the error:

/Users/arthur/dj/drjava/build.xml:1270: Can't find rt.jar in the Java 7 home: ${env.JAVA7_HOME}

I know that rt.jar is in /Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk/Contents/Home/jre/lib.

How do I fix it?

Upvotes: 1

Views: 6806

Answers (4)

Sat Garcia
Sat Garcia

Reputation: 99

I ran into this same problem. Pulak was close, but not quite right: you don't need the jre/lib part at the end. The command that ultimately did the trick for me was:

export JAVA7_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/

Upvotes: 0

Pulak Agrawal
Pulak Agrawal

Reputation: 2481

This answer is same as what others have provided - just a little more detailed. So what you simply need is type this on your shell:

export JAVA7_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk/Contents/Home/jre/lib

Now you have mentioned I know that rt.jar is in /Library/Java/JavaVirtualMachines/jdk1.7.0_07.jdk/Contents/Home/jre/lib.

Usually you would not have Contents/Home inside JDK. A standard Java installation should have jdk1.7.0_07.jdk/jre/lib. Check if you have provided the correct path above and rt.jar is indeed in there.

Upvotes: 3

Kalla
Kalla

Reputation: 165

SET PATH TO JDK..This will solve the issue.

Upvotes: 1

Dan D.
Dan D.

Reputation: 32391

You should make sure you point ant to a JDK rather than to a JRE.

Upvotes: 1

Related Questions