Author Topic: Can't use live errors with JDK 1.8 and Java project 23.0.0.18 hotfix 1  (Read 587 times)

rowbearto

  • Senior Community Member
  • Posts: 1395
  • Hero Points: 108
I have a Java project (not maven). I am using JDK 1.8.192. When I try to enable Live Errors, I'm getting an error message "Path to JDK 1.6 or later must be valid in order to use Live Errors". However my java path is pointing to my JDK 1.8.192 and I'm able to execute and debug, so I think the path to JDK 1.8.19 is proper.

This link https://community.slickedit.com/index.php/topic,16565.msg63940.html#msg63940 states that there were supposed to be some fixes for this issue in SE 2018 RC2, but it seems like the problem still exists.

I'm using Windows x64 23.0.0.18 and hotfix 1.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4794
  • Hero Points: 388
Re: Can't use live errors with JDK 1.8 and Java project 23.0.0.18 hotfix 1
« Reply #1 on: December 28, 2018, 06:58:23 pm »
Took a bit of hacking to get this. Not sure what's going on yet. I worked around it by setting the "Path to JDK 6 or later" to "c:\Program Files\java\jdk1.8.0_192\". It didn't matter for me whether I had hotfix 1 installed.

rowbearto

  • Senior Community Member
  • Posts: 1395
  • Hero Points: 108
Re: Can't use live errors with JDK 1.8 and Java project 23.0.0.18 hotfix 1
« Reply #2 on: December 28, 2018, 07:45:18 pm »
Thanks for taking a look Clark.

My JDK is installed at: C:\Programs\jdk1.8.0_192\

But I think I see my error now. I did not realize that there is a "Path to JDK 6 or later" that I also needed to fill in. I ONLY noticed "JDK Installation Directory" at the bottom, and did not notice that I also need to populate "Path to JDK 6 or later". My "Path to JDK 6 or later" had a bad directory in it, so that is why I had my error.

Probably could reduce user error like this if there was no "Path to JDK 6 or later" to fill in, and the "JDK installation directory" was reused for live errors.

Another usability issue that I just realized I had is that even though my "JDK installation directory" was set to 1.8_192, the "javac.exe" compilation and "java.exe" execution were using java 1.8.102 that are also installed on my system. Turns out the 1.8.102 is in my "PATH" so only putting "javac" and "java" in "Compiler" and "JRE" tabs was getting 1.8.102 to be used. If I put the full path to the javac and java with 1.8.192, then the correct javac and java are chosen.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4794
  • Hero Points: 388
Re: Can't use live errors with JDK 1.8 and Java project 23.0.0.18 hotfix 1
« Reply #3 on: December 28, 2018, 08:29:55 pm »
I think there’s still a bug. SlickEdit is supposed to automatically determine a JDK for live errors when it’s blank (my other JDK path was blank too). This works if JDK 10 is installed. I had to uninstall JDK 10 to see this error you got even though it wasn’t in my PATH.

I think there’s a separate live errors JDK for compatibility. Sometimes it has to be specified separately.

rowbearto

  • Senior Community Member
  • Posts: 1395
  • Hero Points: 108
Re: Can't use live errors with JDK 1.8 and Java project 23.0.0.18 hotfix 1
« Reply #4 on: December 28, 2018, 09:01:31 pm »
OK. If "Path to JDK 6 or later" is blank, does it mean that it will automatically use "JDK Installation Directory" ?

I don't recall ever putting anything into "Path to JDK 6 or later", so I don't know how it got populated beforehand.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4794
  • Hero Points: 388
Re: Can't use live errors with JDK 1.8 and Java project 23.0.0.18 hotfix 1
« Reply #5 on: December 28, 2018, 09:12:34 pm »
I think the reason it doesn’t use that other path is that there is no perfect way to check the JDK version based on the path. Most of the time its easy but it’s not a complete solution. Arguably we could change this logic to assume the other JDK you specified is JDK 6 or higher.

SlickEdit should still have found your JDK for live errors.

rowbearto

  • Senior Community Member
  • Posts: 1395
  • Hero Points: 108
Re: Can't use live errors with JDK 1.8 and Java project 23.0.0.18 hotfix 1
« Reply #6 on: December 29, 2018, 05:00:36 pm »
I think it would be very safe to assume the JDK specified in "JDK Installation Directory" is JDK 6 or later. I doubt anyone is still using JDK 5 or lower these days. If you really want to support JDK 5 or lower you can make that a special case and you will probably have very few or 0 users that would use it. I think its better to structure the UI in a way that prevents users from making mistakes.

rowbearto

  • Senior Community Member
  • Posts: 1395
  • Hero Points: 108
Re: Can't use live errors with JDK 1.8 and Java project 23.0.0.18 hotfix 1
« Reply #7 on: December 30, 2018, 11:11:26 pm »
I think a low hanging fruit to mitigate the usability situation is to enhance the error message: "Path to JDK 1.6 or later must be valid in order to use Live Errors" to indicate that JDK is specified in multiple places in the Java Options and point out which one to check.

I normally think that I only need to specify something once so when I saw this error message I checked my "JDK Installation Directory" and it did not even occur to me that there is another place to specify the path to the JDK for live errors.