Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute Ant for web-applications in Intellij Idea

When I trying to run Ant — he show me an alert with “Project JDK not specified”. How I can use Ant in Intellij Idea for web-applications without JDK?

like image 262
Pavel Frankov Avatar asked Aug 01 '10 10:08

Pavel Frankov


People also ask

How do I compile an Ant project in IntelliJ?

In the Project tool window, right-click the generated build file and select Add as Ant Build File to open it in the Ant tool window. In the Select Path dialog, navigate to the desired build. xml file, and click OK. A build file should have at least a root element to be added to the Ant Build tool window.

Does IntelliJ support Ant?

IntelliJ IDEA supports the latest stable Ant version. Ant is a flexible, platform-independent build tool from Apache Ant Project.

What is Ant in IntelliJ?

Ant build tool window xml to the project. You can use this tool window to add Ant build scripts to your project, control behavior of the build, and run build targets.


2 Answers

Open the Project Structure dialog (press Command + Semicolon shortcut). Navigate to the SDKs in the left pane. In the middle pane, click the + (add), and select "JDK". Make sure you have the JDK installed (available from the Oracle website), and navigate to the root of that location. Click OK. Then open the Ant Build pane on the right side. Right click the build and select Properties. Go to the Execution tab and from the "Run under JDK" drop-down, select the JDK version that you set up prior.

like image 163
Danny G Avatar answered Oct 13 '22 15:10

Danny G


You still need JDK configured for Ant to work, either in the Project or in the Build file properties dialog (you can set custom JDK just for Ant).

like image 41
CrazyCoder Avatar answered Oct 13 '22 15:10

CrazyCoder