Lucas Ojeda
Lucas Ojeda

Reputation: 31

TAB and indentation problems with NetBeans 12.6

here's the deal:

  1. TAB key works fine if I use in a line of code. I press it and it inserts the spaces normally.
  2. If I go to a new line, an empty line with no code, it doesn't work. No matter what. like this:
  1. System.out.pri _ _ nt <-- in this case, it works fine anywhere.
  2. <-- doesn't work.
  3. _ _ <--If I insert spaces using the spacebar, TAB doesn't work either.

This is problem number one. Number 2, indentation.

If I'm writing at any position and press enter, cursor goes all the way back to position 0.

  1. _ _ _ _ _ _ some code I'm writing
  2. | <- cursor goes here

It's really annoying, since I have to constantly indent with the spacebar. Any thoughts? I hope I was able to explain myself clearly. Thank you.

Upvotes: 3

Views: 2432

Answers (1)

skomisa
skomisa

Reputation: 17353

Since you did not state which JDK you are running, I am assuming that you are using JDK 8, because there is an explanation for your problems in that case. If you are not using JDK 8. then update your question accordingly.

If (and only if) you are using JDK 8, there are known issues when using the source editor in NetBeans 12.6. These are collated in NetBeans Bug 6349: Recent builds of the module responsible for java source parsing break BC to JDK 8, which links to five related NetBeans bug reports.

The options to resolve your issues are:

  • Run NetBeans 12.6 with a JDK >= 9. (I have verified that this fixes your issues, so if you still have problems update your question accordingly.)
  • Regress to NetBeans 12.5 or earlier if you must use JDK 8.

Additional notes, based on comments from the NetBeans team in the linked bug report:

  • JDK 8 is now a really old release, and LTS ended over 3 years ago.
  • Although the Release Notes for NetBeans 12.6 state that there is only "experimental support" for JDK 17, that is a documentation error. Therefore, your best option is to stay on 12.6 and upgrade to JDK 17 if that is feasible. Otherwise, upgrade to JDK 11, since both of those JDKs offer LTS.
  • NetBeans 13 is coming next month, but it will not resolve your issues because it will not support JDK 8. There will never be fixes for your editing issues in NetBeans releases >= 12.6 when using JDK 8.

Upvotes: 4

Related Questions