This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 156475 - Project specific JDK is not used for custom ANT tasks
Summary: Project specific JDK is not used for custom ANT tasks
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Freeform (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P3 blocker (vote)
Assignee: Tomas Zezula
: 172890 (view as bug list)
Depends on: 154819
  Show dependency tree
Reported: 2009-01-08 13:31 UTC by roti
Modified: 2010-01-11 04:29 UTC (History)
1 user (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description roti 2009-01-08 13:31:40 UTC

When I create a new web free-form project, the default targets bounded to the IDE actions appears in the nbjdk.xml, 
after I change the java platform to jdk 1.5 (I have jdk 1.6 as default) in the project properties at 'Java sources 

My problem is:
When I add custom ant targets defined in my build.xml, in the project properties, these targets does not appear in 
nbjdk.xml. Therefore running one of these tasks will not use the defined jdk 1.5, but the default 1.6.

because jglick mentioned in Bug 151078 that:
"Currently nbjdk.xml is used _automatically_ only in the case of targets bound to IDE actions."

My question is:
Is it possible to make these custom values appear automaticly in nbjdk.xml?

Comment 1 _ wadechandler 2009-03-31 19:22:38 UTC
It really seems as the IDE tasks are correctly run against the proper libraries, as one would do with their own project
which is where free-form shines, that one of two things would happen here. Either any Ant tasks run in the IDE would use
the projects JDK they belong, or the user would be able to set a JDK needed to run them so certain issues can be avoided. 

For instance, the source and output class format can be changed, but not running with the linked JDK means any custom
Javac or similar tasks requiring the tools to produce classes have a high probability of producing incorrect logic for
the required version of the Java platform for a project; BigDecimals constructor is a good example of this, so we are
talking about compatibility and Java auto expanding values at compile time.

Another issue which arises is that certain tools build class files. They then read specific versions, and expect to find
class files of a specific version which they will be using. JasperReports is one such library using the tools libraries.
Compiling a JasperReport from simple Ant task will fail depending on version requirements etc and class versions. NB
must be run using 1.5 or 1.6, yet there are enterprise applications still using Java 1.4. 

I have one now I must support on 1.4.2_14, and have run into this. I have to run the project build to get Ant to run
correctly. This means I must run over all the targets involved in that versus making a simple report change and only
running targets to compile the report or all reports less all the Java code and everything that involves.

Would this not be a P2 bug instead of a P3 enhancement since it makes Ant difficult to work with from the IDE? I mean, I
can run the targets from the command line just fine, but that means I have to leave the IDE, and that defeats the
purpose of the IDE.
Comment 2 Jesse Glick 2009-09-23 15:59:39 UTC
*** Issue 172890 has been marked as a duplicate of this issue. ***
Comment 3 Antonin Nebuzelsky 2010-01-11 04:29:22 UTC
Changing the default component owner to tzezula.