Chris, thank you for your reply!

I think I may be on to something. I've checked the project properties of the NetBeans Build System and in Java Sources Classpath it had "JDK 12 (Default)" selected for Java Platform. I changed it to JDK 1.8 and the build worked!

However doing so has changed nbbuild/nbproject/nbjdk.properties file:

   diff --git a/nbbuild/nbproject/nbjdk.properties
   b/nbbuild/nbproject/nbjdk.properties
   index e0fb9c040d..d57e670256 100644
   --- a/nbbuild/nbproject/nbjdk.properties
   +++ b/nbbuild/nbproject/nbjdk.properties
   @@ -14,4 +14,4 @@
     # KIND, either express or implied.  See the License for the
     # specific language governing permissions and limitations
     # under the License.
   -nbjdk.active=JDK_1.7
   +nbjdk.active=JDK_1.8

It would seem that the fact I haven't had JDK 1.7 installed made the build try to use default JDK 12 despite the nbjdk.home option and the initial check step allowed the build to continue until it's failed on its own due to JDK 12 incompatibility.

Out of curiosity, I changed the setting back to "JDK 12 (Default)" and the same line has changed to "nbjdk.active=default_platform", so there's also no way back except to checkout the file from git.

Unfortunately, it doesn't seem to help to put "nbjdk.active=JDK_1.8" to user.build.properties or .nbbuild.properties as it seems to be ignored (or maybe rather being too late to have an effect). I haven't found any other way to change that setting without making changes to files under git control, or to change the default Java platform in NetBeans Java Platform Manager. I guess for now I'll have to take care not to commit it by accident.

In any case, I think this little detail is not obvious, at least for the new folks, and perhaps could be reflected on wiki, or better yet somehow addressed in the build process itself. If it sounds like a reasonable request, I may search JIRA and/or create an issue for this.


On 2019/08/12 07:35:43, "Luff,Chris" <[email protected]> wrote:

> If you have the project open in NetBeans, right click on the root of the project, go to Properties and in the tree ensure you have the correct JDK in the Compile leaf and that the Sources match at least 1.7 but go for 1.8. You should be able to build 11.x on anything >=8 but I would try just 8 with 8 sources to start with.>
>
> **Join us on Microsoft Teams<https://teams.microsoft.com/l/channel/19:[email protected]/Clinical%20Timeline?groupId=2b7a095c-9971-48f7-b185-2ddb366be648&tenantId=fbc493a8-0d24-4454-a815-f4ca58e8c09d>**>
>
> On 12 Aug 2019, at 06:41, Korney Czukowski <[email protected]>> wrote:>
>
> Hi all,>
>
> I'm new here, and also to Java development, so please bear with me if I ask any stupid question :) Currently I'm looking around NetBeans ecosystem, trying to figure it out, in hope to implement a few improvements to help me in my work, and if successful, also to contribute these to the general public.>
>
> I've found this page, from which I assumed that NetBeans may be built either from command line or NetBeans itself:>
>
> https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcwiki.apache.org%2Fconfluence%2Fdisplay%2FNETBEANS%2FDevelopment%2BEnvironment&amp;data=02%7C01%7CChris.Luff%40cerner.com%7Ce699decc81964b76225f08d71ee89c3c%7Cfbc493a80d244454a815f4ca58e8c09d%7C0%7C1%7C637011856758266335&amp;sdata=2221IGkmPNhW8ZonSULqWcC0RE8UKhdbQnBhHOCFN3I%3D&amp;reserved=0>
>
> I've been having some troubles making it work though. With NetBeans 11.0 I was unable to build using the CLI, which made me look deeper and discover the NetBeans Build System project and that the build was successful if I ran it from NetBeans instead of CLI. I wasn't able to figure out what was the difference, but I was happy since building from NetBeans seemed more comfortable to me. However after NetBeans 11.1 release and me pulling the latest changes from master, that has changed. Now I seem to be able to build only from CLI, but not from NetBeans and I can't see what am I doing wrong. I haven't installed any other JDK or Ant versions in between.>
>
> I would really like to be able to build from NetBeans. I think there must be something in my setup that I'm missing and I'd like to understand what the issue is before I can focus on the issues I was trying to get to in the first place.>
>
>
> I have both JDK 1.8.0 and 12.0.1 installed (NetBeans runs with the latter), and I've configured the build properties to use 1.8 as advised by the build script (without this option the build stops at the very beginning with a message saying to either add this or another option to permit JDK 1.9+ builds):>
>
> nbjdk.home=c:\\Program Files\\Java\\jdk1.8.0_212>
>
> My Ant is version 1.10.6 (I noticed NetBeans comes with its own Ant of a slightly different version) and I have an environment variable that seems to make it use the correct JDK:>
>
> JAVA_HOME=c:\Program Files\Java\jdk1.8.0_212\>
>
> When I try to build from NetBeans, it always fails at openide.util module, the build log ends with lines similar to these (varies depending on whether the build is full or just one module)>
>
> ...>
> 100 warnings>
> ...>
> ...>
> Compiling 39 source files to C:\Workspace\Netbeans\platform\openide.util\build\test\unit\classes>
> error: Source option 6 is no longer supported. Use 7 or later.>
> error: Target option 6 is no longer supported. Use 7 or later.>
> C:\Workspace\Netbeans\nbbuild\templates\common.xml:587: The following error occurred while executing this line:> > C:\Workspace\Netbeans\nbbuild\templates\common.xml:583: The following error occurred while executing this line:> > C:\Workspace\Netbeans\nbbuild\templates\common.xml:637: The following error occurred while executing this line:> > C:\Workspace\Netbeans\nbbuild\templates\common.xml:615: Compile failed; see the compiler error output for details.>
> BUILD FAILED (total time: 23 seconds)>
>
> By adding an echo task to the file mentioned, I got the details of the failing build task:>
>
> <nb-javac srcdir="C:\Workspace\Netbeans\platform\openide.util\test\unit\src"> > destdir="C:\Workspace\Netbeans\platform\openide.util\build\test\unit\classes">
> excludes="" debug="true" deprecation="true" encoding="UTF-8">
> source="1.6" target="1.6" optimize="off" includeantruntime="false">>
> <classpath refid="test.unit.cp"/>>
> <compilerarg line="-Xlint -Xlint:-serial"/>>
> <processorpath refid="test.unit.cp"/>>
> </nb-javac>>
>
> Any advice appreciated!>
>
>
>
>
> CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. Cerner Limited, Registered in England no 2519305, Registered Office 37 North Wharf Road, London W2 1AF.>
>

Reply via email to