No JDK Specified on ANT Build

Hi,

I have setup a project pretty much bang on like your example http://www.jetbrains.com/idea/docs/Creating_Flex_Applications_with_IntelliJ_IDEA.pdf using the latest IDEA release.  Try as I might though ANT Builds will not run always failing with No JDK Specified?

This is a Flex HelloWorld application, I have JAVA_HOME defined on my system (Mac OS X 10.6.2) and ANT is available on command line.  I am using the bundled ANT version 1.7.1 (have tried my installed version also), set the execution in the ANT build file properties dialogue box to Run under JDK 3.4.0 (Player 9) - Flex SDK.  I have also tried adding the jar files under the Additional Class Path option.  None of this works

Any thoughts welcomed.

Cheers,

Simon



Attachment(s):
Screen shot 2009-12-17 at 22.43.14.png
HelloWorld.mxml.zip
local.build.properties.zip
build.xml
15 comments
Comment actions Permalink

Hi, Simon.

Ant really wants JDK, i.e. Java Developer Kit, but you have provided Flex SDK.

But I would recommend you to give up everything you did and start from scratch. The document you are referring to is 2 years old. Flex support in IDEA has been improved greatly since that time and now you may start HelloWorld project in few clicks, compile, run and debug it without using ant at all.
I'd recommend you to start with few demos. They are a little bit outdated also, because UI has been changed somewhere, but they are much closer to current IDEA 9 release.
http://blogs.jetbrains.com/idea/2009/03/intellij-idea-flex-support/
http://blogs.jetbrains.com/idea/2009/04/improved-flex-support/

More useful features are described in our blog
http://blogs.jetbrains.com/idea/tag/flex/

0
Comment actions Permalink

Thank you for your reply Alexander.  I must say I am very impressed with IDEA and the link to the http://www.jetbrains.com/idea/training/demos/flex_support.html is excellent.  

I actually only followed the latter part of the old pdf you provide because as you state, it is far quicker and simpler now to build a flex application in version 9.  Also I can run a build without ANT as you explained, however, I have custom ANT scripts I obviously need to implement and a majority of my projects will use ANT to build the application.  With this in mind I must persist and get an Ant Build running successfully, is there any further help you could kindly provide?  Do I need to use Flex ANT tasks?

Cheers,

Simon

0
Comment actions Permalink

Yes, of course you may build Flex with ant. It is possible to run Flex compiler as an ordinary java application using <java> task, but morу simple way is to use Flex ant tasks from <Flex SDK>/ant/lib/flexTasks.jar. <Flex SDK>/ant/README is your guide.

0
Comment actions Permalink

Thanks for the rapid response Alexander.  I have built a project I previously had run successfully in Eclipse and now have tried using Flex SDK>/ant/lib/flexTasks.jar to no avail.  I am familiar with  <Flex SDK>/ant/README and have satisfied the criteria it states within that document.  The JDK error keeps getting thrown

0
Comment actions Permalink

Have you fixed ant JDK setting which is set incorrectly at your first screenshot?
Are you able to compile flex by ant from command line?

0
Comment actions Permalink

By the way I noticed that you use Flex SDK 3.4.0.6955. But final release build number is 3.4.0.9271. Is it intentionally?

0
Comment actions Permalink

I am now using the latest Flex SDK (3.5).

Which problem in the screen shot do you refer to specifically?

0
Comment actions Permalink

See first reply:
Ant really wants JDK, i.e. Java Developer Kit, but you have provided Flex SDK.

0
Comment actions Permalink

Sorry about that, wahay nearly there!

OK I have changed the SDK, it now throws no JDK error, its still not building though, its saying Target "/Volumes/Users/newtriks/Playskool/as3/FlexAntTasksExample/build.xml" does not exist in the project "Flex Ant Tasks Build Script"?



Attachment(s):
Screen shot 2009-12-18 at 12.07.35.png
Screen shot 2009-12-18 at 12.03.10.png
build.properties.zip
build.xml
0
Comment actions Permalink

How did you manage to select file path instead of ant target? Anything else in Messages tool window? How did you launch ant build?

0
Comment actions Permalink

How did you manage to select file path instead of ant target?

sorry where have I done that?

Anything else in Messages tool window?

See attached.

How did you launch ant build?

Ant Build [panel] > Run [button]



Attachment(s):
Screen shot 2009-12-18 at 13.31.52.png
0
Comment actions Permalink

> sorry where have I done that
That's what we are interested in..   Why is ant looking for target '/Volumes/Users/newtriks/Playskool/as3/FlexAntTasksExample/build.xml'...
Is result the same if you right-click on target 'clear' or 'build' in Ant Build tool window and then select Run from context menu?

Does your ant build work from command line?

0
Comment actions Permalink

>Why is ant looking for target '/Volumes/Users/newtriks/Playskool/as3/FlexAntTasksExample/build.xml'

No idea ;?

> Is result the same if you right-click on target 'clear' or 'build' in Ant Build tool window and then select Run from context menu?

Yes the result is the same

> Does your ant build work from command line?

Yes

0
Comment actions Permalink

Finally sorted it, I have yet to discover the flaw but a new project and step by step introduction of my script proved to work.  I will blog my logic at some point :-)

Hey Alexander, thank you for your support on this topic its much appreciated!

Cheers,

Simon

0
Comment actions Permalink

Simon,

I had the same problem as your last one - the build filename being mistakenly used as a target - with a "normal" Java project.
Based on your experience, I removed the antfile from the Ant plugin's list, and then put it back - and that cured the problem.
This project was moved around the time the problem showed up - I wonder if that's somehow related.

-Ed Staub

0

Please sign in to leave a comment.