0

I just updated from Netbeans 8.2 to 11 and it seems like Code Templates has stopped working. For example, sout + tab should give a System.out.println(...) and psvm + tab should give a public static void main (..){}

Has anyone else encountered this problem, and if, is there a fix?

It's really annoying since, once you get used to the Code Template Shortcuts, they are hard to live without.

Right now I had to go back to 8.2

Plaul
  • 7,191
  • 5
  • 19
  • 22
  • It worked for me out of the box. Have you had a look under "Tools / Options / Editor / Code Templates" if the code templates are present and "Expand template on" is set to "tab"? – Joachim Rohde Jun 21 '19 at 08:21
  • I already checked that (compared to my 8.2 options) and that's not the problem. Actually, I think theres a problem with my installation, since I found other things that do not work. For example, the wizard "create new Package" creates a file, not a package, and many other "strange things". How did you install NetBeans 11? I am running Windows 8.2, and downloaded the zip-file, and are running netbeans64 directly from the bin-folder – Plaul Jun 21 '19 at 12:17
  • I also just downloaded, unzipped and started NetBeans. Maybe you could try to delete the NetBeans cache (C:\Users\xxx\AppData\Local\NetBeans\Cache\11.0) and also the user directory (C:\Users\xxx\AppData\Roaming\NetBeans\11.0) – Joachim Rohde Jun 21 '19 at 12:32
  • Deleting the Cache and User Directory solved the problem (and all the others). Thanks, Joachim. Can you put your suggestion as an answer, so I can close the question, and provide others with the same problem with a quick way to find the fix? – Plaul Jun 21 '19 at 13:03
  • This problem seemed to occur for me after installing something I was prompted to install/update after launching a fresh install of Netbeans 11.0 (perhaps nbjavac). I can't be sure which but it was definitely working when I first installed Netbeans 11.0 before running those updates. If need be, test on a fresh install without updating anything. – authentictech Jul 26 '19 at 20:03

2 Answers2

4

Delete the NetBeans cache (C:\Users\xxx\AppData\Local\NetBeans\Cache\11.0) and also the user directory (C:\Users\xxx\AppData\Roaming\NetBeans\11.0).

Joachim Rohde
  • 5,915
  • 2
  • 29
  • 46
0

Just changing 1 of your code templates (extra Enter) resolved the issue for me.

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 14 '22 at 00:21