Reputation: 11158
I have NetBeans 8.0.2 installed on my Windows 7 (64-bit) machine. I have also the JDK installed (Java SE Development Kit 8 update 66 (64-bit)).
I want to run ant
from the command line, but the closest I think I've come to getting it to run is the following:
java -jar "C:\Program Files\NetBeans 8.0.2\extide\ant\lib\ant.jar"
but I got the error
Error: Could not find or load main class org.apache.tools.ant.Main
I also tried the following, thinking that Main.class
might be inside ant.jar
, but got the same error:
java -cp "C:\Program Files\NetBeans 8.0.2\extide\ant\lib\ant.jar" -jar "C:\Program Files\NetBeans 8.0.2\extide\ant\lib\ant.jar"
I've spent at least an hour searching online and StackOverflow for the anser. The closest I've found is Compile NetBeans project from command line by using Ant, but it assumes that ant
is accessible from the command line already.
Upvotes: 1
Views: 1659
Reputation: 11158
ant
to work from the command lineC:\Program Files\NetBeans 8.0.2\extide\ant\bin
to your PATHJAVA_HOME
with the value C:\Program Files\Java\jdk1.8.0_66
(adjust this if you end up using a different version, of course).ant
from the command line normally.To rebuild the project, for example, simply do the following:
ant clean jar
Upvotes: 2