I searched the Eclipse settings, the web and StackOverflow, but I couldn't find an answer. Eclipse always folds the import statements and I can't turn it off.
Press: CTRL + SHIFT + O and you should see below dialog boxes. Choose your desired import package and click next. It will prompt you for your next import and thats it. You are done.
Go to Window > Preferences > Java > Editor > Save Actions. Select Perform the selected actions on save (off by default). Ensure that Organize imports is selected (on by default).
Auto Import Java Class In Single Java File. Input the class name in the java source file. Click Source —> Organize Imports menu item or Shift+Ctrl+O in Eclipse, then the java class will be imported in the java source file automatically.
Try this: Go to Preferences » Java » Editor » Content Assist » Advanced. Make sure Other Java Proposals is ticked/checked. If that does not work simply close the project and reopen it.
Go to Window / Preferences, type "import" into the search box, find the "Folding" section and untick "Imports".
(I love the preferences search feature. Alternatively, you can go to Java / Editor / Folding and untick it that way.)
From the menu
Window -> preferences -> java -> editor -> Folding -> "Uncheck box for imports"
Reopen files if necessary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With