Author Topic: Wrong Java String import  (Read 1197 times)

maui

  • Junior Community Member
  • Posts: 6
  • Hero Points: 0
Wrong Java String import
« on: November 02, 2017, 12:59:23 pm »
I'm running version v21.0.3.0 64-bit on Redhat. 

When editing a a Java file and I type String I get an import for a class in a com.xyz package when I want the Java String import and my compiles fail.  Is there a way to fix this?

Thanks.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 3245
  • Hero Points: 461
Re: Wrong Java String import
« Reply #1 on: November 03, 2017, 05:02:26 pm »
Make sure that your JDK tag file is correct:

Tools > Tag Files... > Auto Tag... > Java compiler libraries

Check the items that you want to rebuild, and then click OK.  Wait for the build to tag file build to finish before testing auto-import again.  You should also check in the Symbols tool window under "Java compiler tag file" and verify that you can navigate to "java.lang.String".

We do not hard-code anything for String, except for the logic not to automatically import a class that is found in java.lang, so if you got an incorrect import for String, it is because java.lang.String was not found in your Java tag file.

maui

  • Junior Community Member
  • Posts: 6
  • Hero Points: 0
Re: Wrong Java String import
« Reply #2 on: November 06, 2017, 11:25:51 am »
Thank you very much the tagging solved the issue.