Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to configure organizing of Java imports in Netbeans

Currently Netbeans (I'm using version 7.3.1) has an in-built ability to organize imports in Java files via menu Source » Organize Imports. But I need to change the default order of imports. (For example, when working in a shared environment, software developers must use the same import settings.)

Is there any way to do so?

like image 895
Dmytro Kryvenko Avatar asked Jan 09 '14 15:01

Dmytro Kryvenko


1 Answers

Try:

  1. Click Tools → Options.
  2. Click the Editor icon.
  3. Click the Formatting tab.
  4. Set Language to: Java.
  5. Set Category to: Imports.
  6. Change the settings as desired.
  7. Click OK or Apply to save the changes.

To organize the imports on save:

  1. Click Tools → Options.
  2. Click the Editor icon.
  3. Click the On Save tab.
  4. Check Remove Unused Imports.
  5. Check Organize Imports.
  6. Click OK or Apply to save the changes.
like image 126
Gábor Csikós Avatar answered Sep 28 '22 03:09

Gábor Csikós