The IDE itself needs to run on Java 8 in order to be able to use Gardle 4.10 and less. It is not enough to set up the project compile options to point to Java 8. It is because the listening part of the Gradle daemon would be run in the same JVM as the IDE, the executor part can run on a separate JVM.
Yes, i was running the IDE in /etc/netbeans.conf on JDK 1.8 (Oracle) and i could not get it to use the wrapper. Even now, using JDK 11 (OpenJDK), if i update ./gradle/wrapper/gradle-wrapper.properties from 4.10.2 to 4.10.3, then reload the project in Netbeans (Reload Project), and then Clean and Build, if i do not have the wrapper previously downloaded, then it default to Gradle 6.2.2. Am i misunderstanding something? Am i supposed to run ./gradlew.bat wrapper from the CMDLine to download the wrapper, or why should Netbeans not "sense"the change to the wrapper and redownload the new (4.10.3) gradle version? It seems to me, Netbeans only uses the wrapper *if it is already downloaded previously* and does not initiate download of the wrapper when loading a project? best regards jonathan How should the Options -> Gradle configurations be? On Mon, Mar 16, 2020 at 1:34 AM Laszlo Kishalmi <[email protected]> wrote: > The IDE itself needs to run on Java 8 in order to be able to use Gardle > 4.10 and less. It is not enough to set up the project compile options to > point to Java 8. It is because the listening part of the Gradle daemon > would be run in the same JVM as the IDE, the executor part can run on a > separate JVM. > > BTW. Just tested running the IDE on JAVA 8 uses the wrapper coming with > your project. BTW thanks for the project details. So you have two options: > > - Use NetBeans on Java 8 > > - Upgrade wrapper to at least 4.10.2 > > Created an issue on this: > > https://issues.apache.org/jira/browse/NETBEANS-4014 > > On 3/15/20 2:15 PM, Jonathan Bergh wrote: > > Hi Laszlo, > > > > Thanks for the response - actually, i have tested with both Java 8 > (Oracle) > > and JDK 11 (OpenJDK) and with JDK1.8, still it does not use the wrapper? > > > > Is this because Netbeans 11.3 needs to run on >JDK9? > > > > Should it use the wrapper if IDE is running JDK 1.8? > > > > Thanks Jonathan > > > > On Sun, Mar 15, 2020 at 10:38 PM Laszlo Kishalmi < > [email protected]> > > wrote: > > > >> The big question. What version of Java are you running the IDE with? > >> > >> We cannot use Gradle runtime 4.6 (or anything below 4.10.2) with java 11 > >> or above, so we fall back to the Gradle version shipped with the IDE. > >> > >> So try to run it when the IDE is running on Java 8 or upgrade your > >> projects to Gradle 4.10.2 at least. > >> > >> BTW, yes it would be nice if the Nb would call out this issue and not > >> just doing some silent changes. > >> > >> On 3/15/20 11:22 AM, Jonathan Bergh wrote: > >>> Hi Laszlo, > >>> > >>> Yes, i can. I'll have to sanitise it quite a lot though. I'll send to > >> your > >>> personal email if you dont mind ... > >>> > >>> Regards > >>> Jonathan > >>> > >>> On Sun, Mar 15, 2020 at 7:54 PM Laszlo Kishalmi < > >> [email protected]> > >>> wrote: > >>> > >>>> Just for curiousity, can you zip the project base dir content + the > >>>> gradle directory and put it somewhere? No other sources are required, > >>>> just the settings.gradle, build.gradle, gradlew, gradlew.bat and the > >>>> gradle directory (recursively) > >>>> > >>>> On 3/15/20 10:36 AM, Jonathan Bergh wrote: > >>>>> I have restarted NB, same behaviour. > >>>>> > >>>>> Did you clear your .gradle/wrapper/dists directory? If i have a > >>>> successful > >>>>> build via cmdline, and the correct wrapper is downloaded, then yes, > it > >>>>> works fine. Trying a wrapper build inside NB always defaults to the > >> 6.2.2 > >>>>> installation. > >>>>> > >>>>> Even when opening NB fresh, i can see Gradle 6.2.2 complaining about > >>>>> plugins which work only with the older wrapper 4.6. > >>>>> > >>>>> Regards > >>>>> Jonathan > >>>>> > >>>>> On Sun, Mar 15, 2020 at 7:28 PM Patrick Musembi < > >> [email protected] > >>>>> wrote: > >>>>> > >>>>>> Mine works fine. Even after setting the path on Gradle > >>>> distribution->Custom > >>>>>> to 5.4 uses the wrapper. I don't know if you should restart > netbeans? > >>>>>> > >>>>>> On Sun, Mar 15, 2020, 20:16 Jonathan Bergh < > [email protected]> > >>>>>> wrote: > >>>>>> > >>>>>>> hi @patrick > >>>>>>> > >>>>>>> So in Option -> Gradle, selecting Custom (leaving entry blank) then > >>>> Tick > >>>>>>> Prefer Wrapper? > >>>>>>> > >>>>>>> This doesnt seem to make any difference :( > >>>>>>> > >>>>>>> The project is still building with the 6.2.2 distribution, which is > >> the > >>>>>>> only one in the ./.gradle/wrapper/dists directory at this stage. > >>>>>>> > >>>>>>> If i run ./gradew.bat manually from the cmdline, then, the correct > >>>>>> version > >>>>>>> (4.6) is download, and then someone Netbeans uses this version from > >>>> then > >>>>>> on > >>>>>>> in. > >>>>>>> > >>>>>>> On Sun, Mar 15, 2020 at 6:59 PM Patrick Musembi < > >>>> [email protected] > >>>>>>> wrote: > >>>>>>> > >>>>>>>> @jonathan please set Custom. Leave the input field empty(haven't > >>>> tested > >>>>>>>> with a custom gradle path). Then tick prefer to use gradle wrapper > >>>> that > >>>>>>>> comes with the project > >>>>>>>> Regards > >>>>>>>> > >>>>>>>> On Sun, Mar 15, 2020, 19:00 Jonathan Bergh < > >> [email protected]> > >>>>>>>> wrote: > >>>>>>>> > >>>>>>>>> An update: > >>>>>>>>> > >>>>>>>>> If i run from Powershell in the Project directory: > >>>>>>>>> > >>>>>>>>> > >>>>>>>>> *PS C:\Development\myproject> ./gradlew --configure-on-demand -x > >>>>>> check > >>>>>>>>> clean buildDownloading > >>>>>>>>> https://services.gradle.org/distributions/gradle-4.6-all.zip > >>>>>>>>> <https://services.gradle.org/distributions/gradle-4.6-all.zip > >>> ....* > >>>>>>>>> it starts downloading the Wrapper, and ./.gradle/wrapper/dists > gets > >>>>>>>>> populated with gradle-4.6-all.zip as expected. > >>>>>>>>> > >>>>>>>>> Regards > >>>>>>>>> Jonathan > >>>>>>>>> > >>>>>>>>> On Sun, Mar 15, 2020 at 5:48 PM Jonathan Bergh < > >>>>>>> [email protected] > >>>>>>>>> wrote: > >>>>>>>>> > >>>>>>>>>> ok, thanks Lazlo, > >>>>>>>>>> > >>>>>>>>>> I have just cleared my ./.gradle/cache and > ./.gradle/wrapper/dist > >>>>>>>>>> directories, set global Gradle options to Gradle 6.2.2 but > Prefer > >>>>>>>> gradle > >>>>>>>>>> wrapper. > >>>>>>>>>> > >>>>>>>>>> When i build my project, the output is: > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> *JAVA_HOME="C:\Program Files\Java\jdk1.8.0_201"cd > >>>>>>>>>> C:\Development\myproject; ./gradlew --configure-on-demand -x > check > >>>>>>>> clean > >>>>>>>>>> buildConfiguration on demand is an incubating feature.> Task > >>>>>> :clean> > >>>>>>>> Task > >>>>>>>>>> :compileJavaNote: Some input files use unchecked or unsafe > >>>>>>>>> operations.Note: > >>>>>>>>>> Recompile with -Xlint:unchecked for details.> Task > >>>>>> :processResources> > >>>>>>>>> Task > >>>>>>>>>> :classes> Task :jar> Task :assemble> Task :buildDeprecated > Gradle > >>>>>>>>> features > >>>>>>>>>> were used in this build, making it incompatible with Gradle > >> 7.0.Use > >>>>>>>>>> '--warning-mode all' to show the individual deprecation > >>>>>> warnings.See > >>>>>> > >> > https://docs.gradle.org/6.2.2/userguide/command_line_interface.html#sec:command_line_warnings > >>>>>>>>>> < > >> > https://docs.gradle.org/6.2.2/userguide/command_line_interface.html#sec:command_line_warnings > >>>>>>>>>> BUILD > >>>>>>>>>> SUCCESSFUL in 5m 6s4 actionable tasks: 4 executed* > >>>>>>>>>> > >>>>>>>>>> When i check back in ./.gradle/wrapper/dists , there is only a > >>>>>> 6.2.2 > >>>>>>>>>> installation, and cache also only has artifacts for 6.2.2 > >>>>>>>>>> > >>>>>>>>>> The project gradle wrapper (gradle-wrapper.properties) is: > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >> > *distributionBase=GRADLE_USER_HOMEdistributionPath=wrapper/distsdistributionUrl=https\:// > >>>>>>>>> services.gradle.org/distributions/gradle-4.6-bin.zip > >>>>>>>>>> <http://services.gradle.org/distributions/gradle-4.6-bin.zip > >>>>>>>>>> zipStoreBase=GRADLE_USER_HOMEzipStorePath=wrapper/dists* > >>>>>>>>>> > >>>>>>>>>> So i am sure perhaps that Netbeans is not using the project > gradle > >>>>>>>>> wrapper? > >>>>>>>>>> Regards > >>>>>>>>>> Jonathan > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> On Sun, Mar 15, 2020 at 5:00 PM Laszlo Kishalmi < > >>>>>>>>> [email protected]> > >>>>>>>>>> wrote: > >>>>>>>>>> > >>>>>>>>>>> Unfortunately attachments are not working in dev mailing list. > >> You > >>>>>>> can > >>>>>>>>>>> share them some clipboarding site or you can create a JIRA > issue > >>>>>> on > >>>>>>>> this > >>>>>>>>>>> and do the report there. > >>>>>>>>>>> > >>>>>>>>>>> Right now the wrapper detection checks the existence of > >>>>>>>>>>> gradle/wrapper/gradle-wrapper.properties in the root project. > >>>>>>>>>>> > >>>>>>>>>>> > >>>>>>>>>>> On 3/15/20 7:24 AM, Jonathan Bergh wrote: > >>>>>>>>>>>> Hi there, > >>>>>>>>>>>> > >>>>>>>>>>>> Just a quick question. We usually use Maven for build, for > which > >>>>>>>>>>>> everything seems to work perfectly on NB11.3. However, we > have a > >>>>>>>>>>>> project which uses Gradle for other reasons. > >>>>>>>>>>>> > >>>>>>>>>>>> When building on 11.3, via the IDE, i have "Use wrapper" set > in > >>>>>>>> global > >>>>>>>>>>>> IDE options but when i build (Clean Build) from the Project > >>>>>> menu, > >>>>>>>>>>>> Netbeans seems to be using the globally configured Gradle > >>>>>>>>>>>> installation, rather than the Wrapper version? > >>>>>>>>>>>> > >>>>>>>>>>>> please see the attached. if i run from the command line, > >>>>>>> everything > >>>>>>>>>>>> builds fine, including finding the various plugins etc. > >>>>>>>>>>>> > >>>>>>>>>>>> Just wanted to check whether this was a real issue before > >>>>>> logging. > >>>>>>>>>>>> Thanks a lot. > >>>>>>>>>>>> > >>>>>>>>>>>> Regards > >>>>>>>>>>>> Jon > >>>>>>>>>>>> gradle3.JPG > >>>>>>>>>>>> gradle2.JPG > >>>>>>>>>>>> gradle1.JPG > >>>> --------------------------------------------------------------------- > >>>> To unsubscribe, e-mail: [email protected] > >>>> For additional commands, e-mail: [email protected] > >>>> > >>>> For further information about the NetBeans mailing lists, visit: > >>>> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > >>>> > >>>> > >>>> > >>>> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [email protected] > >> For additional commands, e-mail: [email protected] > >> > >> For further information about the NetBeans mailing lists, visit: > >> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > >> > >> > >> > >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > For further information about the NetBeans mailing lists, visit: > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > > > >
