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.
Summary: | Allow JDK/JRE/Java Platform user selection in free-form projects properties for the IDE to use with code completion, ANT builds, IDE features while run inside the IDE. | ||
---|---|---|---|
Product: | java | Reporter: | _ wadechandler <wadechandler> |
Component: | Freeform | Assignee: | Milan Kubec <mkubec> |
Status: | RESOLVED DUPLICATE | ||
Severity: | blocker | ||
Priority: | P2 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
_ wadechandler
2006-12-22 06:17:02 UTC
I added the following comments to issue 64160. I'm not sure what the end result of that issue will be yet, but these two issues go hand in hand. It makes sense to run ANT under the selected platform as the user may be using a Java 1.6 or future 1.7 JVM for the free-form project when the IDE may be run on say 1.5 or vice versa. That way any issues such as a missing constructor or method because of overloading will be handled correctly and not leave the issue hard to track down for an unsuspecting user. I have run into issues such as this, and it would not be addressed by only using the code completion features if the user did not do something such as open all the files and look at them all as compilation can succeed only to leave issues at runtime. A perfect example is if the IDE is run on 1.5 and the user has the platform set to 1.4 and source level at 1.4 (assuming only code completion uses 1.4 and not compilation). They may have a file which someone used something such as a BigDecimal constructor. In 1.5 there is BigDecimal(int) and BigDecimal(double), however in 1.4 there is only BigDecimal(double). If a source file calls "new BigDecimal(5);" this will cause an issue if the IDE is run on 1.5 and ANT uses 1.5 to compile the project and the user expects to be able to run it on 1.4. What will happen is the 1.5 compiler will link to the method BigDecimal(int) and when run on a 1.4 JVM the user would get a LinkageError. If the user had compiled the sources with 1.4 the compiler would have promoted the int to a double for the call, and the correct method would have been linked to, and the user would be able to run the final classes on a 1.4 or 1.5 JVM. The main issue is that there are transparent issues which arise with both things (ANT script targets and IDE features) not using the same Java platform. Issue #64160 is already implemented in 6.0 builds. An explicitly selected target platform controls all aspects of the project's compilation and running. It does not matter in that case what version of Java you run the IDE on. *** This issue has been marked as a duplicate of 64160 *** |