Author Topic: java live error reports errors yet actual build has no error  (Read 127 times)

rowbearto

  • Senior Community Member
  • Posts: 1541
  • Hero Points: 113
java live error reports errors yet actual build has no error
« on: November 26, 2019, 10:41:23 pm »
Look for analyzer-live-errors.7z on support.

See the "README" file for description/repro steps.

rowbearto

  • Senior Community Member
  • Posts: 1541
  • Hero Points: 113
Re: java live error reports errors yet actual build has no error
« Reply #1 on: November 27, 2019, 01:41:02 am »
So I see in my user.cfg.xml file that there is this:

Code: [Select]
<p n="def_java_live_errors_jdk_6_dir" v="C:\Programs\jdk1.8.0_192\"/>
<p n="def_java_live_errors_jvm_lib" v="C:\Programs\jdk1.8.0_192\jre\bin\server\jvm.dll"/>

which tells live errors to use jdk1.8.0_192.

I set that a long time ago on a different project.

In a gradle project, the Build->Java Options is not present, so no way to change this option from the GUI?

Is it possible that jdk8 is used for my live errors while I'm using jdk11 for my build (set via JAVA_HOME)?

Couldn't the live errors use the same compiler that I have set for Java in the project properties->Compile/Link?

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1164
  • Hero Points: 110
Re: java live error reports errors yet actual build has no error
« Reply #2 on: November 27, 2019, 03:07:05 pm »
Yeah, it should show the java options for that type of gradle project.  It looks like just running the command to bring up that dialog isn't 100% happy about something in the project's markup, so right now the only workaround to change the Live Errors JDK is to set-var def_java_live_errors_jdk_6_dir to the JDK path you want.  I'll have to look into the GUI problem.

The Live Errors JDK is global, and not per project.  I think it makes more sense now to use the project JDK and just keep the global setting as a fallback if we can't use/determine the project JDK.  I've already got some work lined up for Live Errors that I can fold investigating this into.

That said, what was the error you were getting in that project?  I've tried it on linux (which meant I had to run Build Options to get binary dependency paths in the vpw correct for my system), but after I did that, no errors unless I introduced them.  Or were you saying the old JDK setting you had for live errors was making it fail to compile?

rowbearto

  • Senior Community Member
  • Posts: 1541
  • Hero Points: 113
Re: java live error reports errors yet actual build has no error
« Reply #3 on: November 27, 2019, 08:52:59 pm »
Patrick: After updating the macro variable for the correct JDK, the error that I was seeing went away.

But I have since been writing more code, and now I have a scenario where Live errors reports an error while the actual gradle build has no errors, even though Live errors is using the correct JDK now. I think that Live errors should not be reporting this error.

To see/reproduce this issue, look for analyzer-1127-1.7z on support, open the README file, and then look at item "C"

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1164
  • Hero Points: 110
Re: java live error reports errors yet actual build has no error
« Reply #4 on: December 02, 2019, 07:20:21 pm »
I haven't gotten the errors.  The two main differences in my setup right now is I'm trying it on linux, and my openjdk version is 11.0.4.  So I'm going to give a try on windows with openjdk 11.0.5, once I get it set up later today.