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.
When using apisupport to develop netbeans modules, I cannot specify a Java Platform to be used to build the project. This might lead to problems when the IDE is running in 1.5, but 1.4.2 is required to build the modules.
It is rare to actually require the earlier JDK to build modules, since <javac> is run with source="1.4" or whatever you specify, and there are few source incompatibilities between JDK releases. (Usually just things like people implementing AWT peers or DOM interfaces.) However there might be an error that would be caught when compiling under JDK 1.4.2 which is not caught when compiling under JDK 1.5. On the other hand, assuming you have a 1.4 JDK registered in the Java Platform Manager, it will be used for code completion and background compilation, so you should e.g. see error highlights immediately upon accidentally typing if (something.getName().contains(" ")) { since the 1.4 java.lang.String has no 'contains' method. A problem with this is that line numbers in JDK sources (from stack traces, debugging, ...) will not match up if you have a 1.4 JDK registered. Some apps might really need to be tested on the earlier JDK, not on the IDE's JDK. Anyway, currently no plans to fix in 4.2 - there just wasn't time; and it's a format + UI change, so too late unless an exception is granted.
P2 DEFECT? It would certainly be convenient to be able to specify the JDK to build on and it's on the feature list for future versions. It most likely won't be implemted for NB 5.0. It seems to me that for a majority of cases, the user should be able to use a simple workaround: run the IDE on the JDK that should be used as the platform for building NB module projects. Is there a specific scenario where this workaround wouldn't work?
OK, P2 is perhaps too high (i'm lowering the issue to P3). On the other hand every other project type (J2SE, J2EE, J2ME) allows the user to specify JDK to be used to build the project. Personally I find this "defect" quite annoying, since I'm running NetBeans on 1.5 (I'm using antialiased text in Swing widgets), developing for 1.4, therefore I have to build the projects manually from the command line. Anyway it would be very nice to have such ability in api support.
FWIW, I agreed with the P2 categorization. Running the IDE on an older JDK is not a reasonable workaround.
Created attachment 28057 [details] First draft; build script changes only
Working on it. Nothing too hard, but lots of details to take care of.
Created attachment 28058 [details] Refined patch (still build scripts only); also: files-layout.txt, and s!${jdkhome}/lib/tools.jar!${tools.jar}!g in various build.xml and project.properties
Current build script patch does not work, due to an Ant bug (or design flaw): http://issues.apache.org/bugzilla/show_bug.cgi?id=38040 Build fails when calling into a module like mdr/module which is a wrapper for a j2seproject: the j2seproject gets the presetdef for <javac> but not the actual property ${nbjdk.javac}.
Need to patch module build scripts which call an external script like this: <ant ... inheritall="false"/> to read: <ant ... inheritall="false"> <propertyset> <propertyref prefix="nbjdk."/> </propertyset> </ant>
Tried to use a presetdef on <ant> itself to get that effect, but doesn't work: Ant 1.6.5 uses (Ant) getProject().createTask("ant") in <antcall/> (CallTarget.java), which then fails with a CCE if you presetdef'd <ant>. This bug is fixed in Ant 1.7, but too late for us: svn log -r277700 https://svn.apache.org/repos/asf/ant/core/trunk ------------------------------------------------------------------------ r277700 | stevel | 2005-02-18 18:28:00 -0500 (Fri, 18 Feb 2005) | 4 lines This commit eliminates all (but one) use of Project.createTask("some name") from the codebase. [...] ------------------------------------------------------------------------
Found a different workaround, no need for patches to module build scripts.
Created attachment 28072 [details] New running patch (incl. a few unrelated project.xml changes)
Created attachment 28073 [details] Changes needed for code completion etc. to work
Created attachment 28078 [details] GUI patch
Implemented: committed 1.10 ant/debugger/nbproject/project.properties committed 1.25 ant/nbproject/project.properties committed 1.6 apisupport/harness/build.xml committed 1.9 apisupport/harness/manifest.mf committed 1.11 apisupport/harness/nbproject/project.properties committed 1.28 apisupport/harness/release/README committed 1.8 apisupport/harness/release/build.xml committed 1.26 apisupport/harness/release/jnlp.xml committed 1.14 apisupport/harness/release/run.xml committed 1.25 apisupport/harness/release/suite.xml committed 1.134 apisupport/project/src/org/netbeans/modules/apisupport/project/NbModuleProject.java committed 1.6 apisupport/project/src/org/netbeans/modules/apisupport/project/queries/ClassPathProviderImpl.java committed 1.67 apisupport/project/src/org/netbeans/modules/apisupport/project/ui/customizer/Bundle.properties committed 1.11 apisupport/project/src/org/netbeans/modules/apisupport/project/ui/customizer/CustomizerLibraries.form committed 1.41 apisupport/project/src/org/netbeans/modules/apisupport/project/ui/customizer/CustomizerLibraries.java added 1.1 apisupport/project/src/org/netbeans/modules/apisupport/project/ui/customizer/JavaPlatformComponentFactory.java committed 1.10 apisupport/project/src/org/netbeans/modules/apisupport/project/ui/customizer/ModuleProperties.java committed 1.46 apisupport/project/src/org/netbeans/modules/apisupport/project/ui/customizer/SingleModuleProperties.java committed 1.10 apisupport/project/src/org/netbeans/modules/apisupport/project/ui/customizer/SuiteCustomizerLibraries.form committed 1.23 apisupport/project/src/org/netbeans/modules/apisupport/project/ui/customizer/SuiteCustomizerLibraries.java committed 1.25 apisupport/project/src/org/netbeans/modules/apisupport/project/ui/customizer/SuiteProperties.java committed 1.33 apisupport/project/test/unit/src/org/netbeans/modules/apisupport/project/NbModuleProjectTest.java committed 1.30 apisupport/project/test/unit/src/org/netbeans/modules/apisupport/project/TestBase.java committed 1.5 debuggerjpda/ant/nbproject/project.properties committed 1.6 debuggerjpda/api/nbproject/project.properties committed 1.2 debuggerjpda/api_examples/FilterringOfCallStackViews1/nbproject/project.properties committed 1.2 debuggerjpda/api_examples/SmartSteppingListener1/nbproject/project.properties committed 1.10 debuggerjpda/nbproject/project.properties committed 1.4 debuggerjpda/ui/nbproject/project.properties committed 1.126 ide/golden/files-layout.txt committed 1.6 ide/projectimport/nbproject/project.properties committed 1.12 j2ee/ddapi/nbproject/project.properties committed 1.3 j2ee/debug/nbproject/project.properties committed 1.2 j2eeserver/ant/nbproject/project.properties committed 1.24 java/j2seproject/nbproject/project.properties committed 1.18 java/project/nbproject/project.properties committed 1.721 nbbuild/build.xml committed 1.11 nbbuild/default-properties.xml committed 1.20 nbbuild/default.xml added 1.1 nbbuild/jdk.xml committed 1.31 nbbuild/misc/full-build-linux.sh committed 1.31 nbbuild/nbproject/project.xml committed 1.29 nbbuild/templates/common.xml committed 1.62 nbbuild/templates/projectized.xml committed 1.38 testtools/build.xml committed 1.18 web/ddapi/nbproject/project.properties committed 1.16 web/project/nbproject/project.properties committed 1.13 websvc/core/nbproject/project.properties committed 1.81 xml/core/build.xml committed 1.70 xml/tax/build.xml
Also: Checking in project.xml; /cvs/nbbuild/nbproject/project.xml,v <-- project.xml new revision: 1.32; previous revision: 1.31 done
verified just implementation; will be tested for 5.1 and posible issues will be filed separatly. V.