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

rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
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: 2335
  • Hero Points: 132
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: 1818
  • Hero Points: 151
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: 2335
  • Hero Points: 132
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: 1818
  • Hero Points: 151
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.


rowbearto

  • Senior Community Member
  • Posts: 2335
  • Hero Points: 132
Re: java live error reports errors yet actual build has no error
« Reply #5 on: December 16, 2019, 08:49:59 PM »
I think I found something related to this original issue and possibly its cause, and also why Patrick could not reproduce it.

When I am editing Java file "B", the Messages tab shows a live error in another file (file "A") that no longer exists, I fixed it long ago.

However if I copy my entire project directory structure somewhere else, reload it and open the file "B" in that project, I don't see this live error anymore.

Going back to the original project: even if I right click "delete" on the live error, if I switch to another file, then come back to file "B", the old live error comes back again even though I "deleted" it.

How to "delete" it for good so it stops showing up? Is it cached somewhere?

To try and answer my own question, I searched my config directory for a string in the error message and found a sub directory "java_rte_classes". I closed SE, then deleted the "java_rte_classes" directory, and now this false live error doesn't show up anymore when I relaunch SE on this project and view the file.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: java live error reports errors yet actual build has no error
« Reply #6 on: December 16, 2019, 08:56:41 PM »
Interesting, that definitely gives me something to look at.  That sounds like we missed an event somewhere and left the cache in a bad state somehow.