Gradle Source Version on Netbeans

70 views
Skip to first unread message

will...@gmail.com

unread,
Mar 23, 2021, 9:25:36 PM3/23/21
to BoofCV
Pulled the latest version from github and able to build/run from command line. Loaded project into Apache Netbeans 12.1 with JDK 14.02 as based JDK

Netbeans code editor is trying to help highlight problems and based on imported gradle settings it thinks the source is 1.8 so get "var" warning messages and other new language features. 

I searched on gradle settings to try and find the property that needs to be set. Could be a netbeans bug or I am missing something. I have minimal experience with tweaking gradle.

Clicking on Project Properites Nebeans shows "Source/Binary Format:" as 1.8.

The code compiles and able to run but would like to suppress the warnings. 

Also not sure if we had a different problem using JDK 15 that it was throwing lots of error/warning messages.  




Peter A

unread,
Mar 24, 2021, 12:10:23 AM3/24/21
to boofcv
Sounds like Netbeans is having the same issue IntelliJ is having with a new Gradle feature. If you don't need bleeding edge features you can just checkout the last stable release with `git checkout v0.37`

Gradle very recently came out with a new feature called Toolchains. This is a really useful feature as I can now specify the exact version (or even distribution) of Java that BoofCV is built with. If you don't have that JDK installed on your system it will download it automatically. BoofCV's build has been getting more complex the past year or so to allow new language features, static checks, CI, and bytecode compatibility. As a result I've been getting more messages about build problems because people either have a version of Java that's too old or too new. That's now fixed.

The downside is that Toolchains is so new IDE's don't support it yet. I already submitted a bug report to IntelliJ. Could you maybe submit one to Netbeans?


My temporary work around is to comment out this line in boofcv/build.gradle

Line 53: tasks.withType(JavaCompile).configureEach { options.release = 8 }


--
You received this message because you are subscribed to the Google Groups "BoofCV" group.
To unsubscribe from this group and stop receiving emails from it, send an email to boofcv+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/boofcv/660f3e8d-7eb8-4716-a0d0-0c33b22ad90bn%40googlegroups.com.


--
"Now, now my good man, this is no time for making enemies."    — Voltaire (1694-1778), on his deathbed in response to a priest asking that he renounce Satan.

Scooter Willis

unread,
Mar 24, 2021, 8:02:06 AM3/24/21
to boo...@googlegroups.com
Will do. 

You received this message because you are subscribed to a topic in the Google Groups "BoofCV" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/boofcv/7EqKB1pRO9Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to boofcv+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/boofcv/CAFKAwfvcmjmBhe0tyE3pZz%2BVkH74LM_6W93FP4v%2BE18qmJzBCA%40mail.gmail.com.

will...@gmail.com

unread,
Mar 24, 2021, 12:40:19 PM3/24/21
to BoofCV
It didn't lioke commenting out the options.release = 8 in that netbeans was complaining and try not to have netbeans complain!!

Change it to options.release = 14 and that made netbeans happy in that it is now validating source code as the IDE using 14 not 8.

For the Test Packages in boofcv:applications not able to find BoofStandardJUnit

In boofcv:demonstrations VisualizeBinaryContourApp missing methods controls.getThreshold() and controls.getConnectRule();  Same for DetectPolylineApp missing method control.getThreshold();

VideoStichBaseApp missing method infoPabel.isShowView() 

Not sure if that is related to gradle build process or code changes that haven't been refactored. 

Peter A

unread,
Mar 24, 2021, 12:50:39 PM3/24/21
to boofcv
Sounds like a Netbeans issue. Might need to purge a cache then reload. You can double check the Gradle script using this command:

./gradlew applicationsJar

I'm assuming you've already run autogenerate or else you would be having more significant issues. I just ran it myself locally and didn't have any issues.

Scooter Willis

unread,
Mar 24, 2021, 1:18:45 PM3/24/21
to boo...@googlegroups.com
Yes did autogenerate at command line but that seems to get netbeans thinking it needs to build again as things changed. Kicking off a nebeans clean and build you can see it go through the marking and unmarking of code that isn't correct as it resolves dependencies. From netbeans did the drill down on parent classes related to the missing methods and they end up at StandardAlgConfigPanel where it only has bytecode to show and does not have the "missing" methods.  Looking at the source in StandardAlgConfigPanel.java does not have isShowView() method if that is connected to autogeneration. 

Let me know if anything else I should test to try and get to the missing step in that using  StandardAlgConfigPanel would not have methods getThreshold()  isShowView() and getConnectRule(). Going to assume that methods shouldn't be missing but the code in the methods may need changes for the deployment platform. 

Reply all
Reply to author
Forward
0 new messages