score:11
In this following picture, MyClass.java
has a hollow J
, because it is explicitly excluded from the sources to build:
Could you go to the properties of the project, "Java Build Path
" Section, "Source
" tab and see if some exclusion filter has been set ?
It is usual for instance to define:
**/Test*.java
to exclude at first building any unit-test class (when you have a large set of sources and do not want to be presented with Test classes during auto-completion, or do not want them considered during source searches).
score:0
Make sure you have the right directory structure. I believe that:
- Hollow J icon beside Java file - will not be build
- Normal J icon beside Java file - is a file to be build.
I made a mistake when I created webapp artefact. By default it does not create folder for Java, but for resources. I mistakenly put my sources there. Have a look - see the difference.
score:0
I was able to get this fixed in Visual Studio Code, VSCode but entering crtl-shift-p
and typing in clean. When I did that I ran the "Java: Clean Java Language Sever Workspace" command. This fixed my autocomplete issue for me.
score:1
As an addendum to the @VonC answer, make sure that the Java files are part of the Inclusion pattern. I had a case where a build process was creating the project while only including .js files and not the Java files:
You can manually edit the inclusions via the Edit button. In my case, a fix was made to the build script to make it permanent.
score:1
Neither Restoring Defaults or my build path (file was already in package directory w/other files where auto-complete was working) fixed problem. Fix for me was to close the file explicitly (right click on file name in tab) and re-open. Interestingly, just re-starting Eclipse didn't work either.
score:2
I cope with the issue by deleting the file if autocomplete does not work. Just before copying the source code. Then I have recreated the java file with the same name. Pasted the source code previously copied.
score:10
Those with a hollow J aren't part of the build path of the project, so they can't participate in the normal build process and therefore auto-complete won't be enabled for these files (and other Java editor features!). You must add the folders with the Java files to be built to the build path using the 'source path' section of the project properties. This can be accessed by right clicking on a project in the project navigator / package explorer and going to Properties. See http://www.informit.com/articles/article.aspx?p=367962 for details.
Additionally, if the files aren't part of a Java project in the first place, you must create a project and move the files in, or put the files in an existing one. Again, make sure these file are under a source directory as described by that section of the project properties.
(source: teradata.com)
score:18
some answers (restore defaults) above do not work for some adt bundle installs as of jan '13.
in those cases, go to
Window -> Preferences -> Java -> Editor -> Content Assist -> Advanced
and tick on the JAVA PROPOSAL options.
score:103
Since this question is highly ranked on Google, I will add a solution to fix general auto complete issue, not for 'hollow J' ones.
Try Window (Windows/Linux) or Eclipse (OS X) -> Preferences -> Java -> Editor -> Content Assist -> Restore Defaults
also
Content Assist -> Advanced -> Restore Defaults
Source: stackoverflow.com
Related Query
- Eclipse autocomplete not working in some Java files
- Eclipse autocomplete not working for some source files
- @BeforeAll not working in SOME files in Eclipse
- Eclipse content assist not working for Java objects within Groovy files
- Eclipse Pydev autocomplete not working with error: java.lang.RuntimeException: The python client still hasn't connected back to the eclipse java vm
- Eclipse autocomplete not working
- Eclipse CDT Autocomplete not working
- Graphical Layout tab does not appear for some layout files into Eclipse
- Eclipse Java Content Assist not working
- Eclipse autocomplete is not working for PHP-project
- Android: Eclipse autocomplete does not work in xml files
- apache tomcat 9.x not working with eclipse & Java 10.0.1
- Ant not working in Eclipse Kepler (Java Virtual Machine Launcher - A Java Exception has occured)
- eclipse not working - No java virtual machine was found
- Eclipse not able to open java files -> Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass
- Autocomplete not working with Eclipse Oxygen Javascript project
- java application not working with java9 and eclipse
- Eclipse Java 11 classpath only not working compared to Maven
- How Exclude some files from Eclipse Java EE Web Application project Deployment Assembly
- Eclipse + JBoss - some JAR files not deployed
- Files externally added to working directory not showing up in Eclipse
- Eclipse code fomatter not working for Java Generics code?
- I can't link css files to html is not working on eclipse
- Scala IDE not working properly in Eclipse Luna for Java EE
- Eclipse content assist not working in some parts of code
- Java project working on Eclipse but not working when exported to runnable jar file
- Java Eclipse android-XML editor (graphic display) is not working
- Eclipse not working after deleting a version of java
- UTF-8 encoding not working with Eclipse java application
- Eclipse Generate Gradle build files not working
More Query from same tag
- How to view a longer code revision history in Eclipse
- Why does Spark application throw "java.lang.NoSuchMethodException"?
- Linking JSF libraries from JBoss in Maven
- I try to make a guess game and let user decide under what max number to guess
- How to show maven artifact version in eclipse Package Explorer
- Will installing Egit interfere with existing Git installation?
- import cv2 ImportError: DLL load failed: %1 Allready have checked related posts
- Use Maven to build complex Flex project
- Local Eclipse plugin repo for a team
- Why the import android.support.v7.widget.Toolbar cannot be resolved in my project
- Get imageviews current scale value
- How to save column order and the width of the re-sized columns after changing the size of columns in NAT table into the prefernce
- JavaFx not accepting Media Source file
- Out of the sudden (after an Android SDK Manager packages update) an Apache import stopped resolving
- Where does the java.util.logging log file or output go?
- Eclipse Feature Deployment into other Applications
- getting OSGI Bundle from Eclipse IConfigurationElement
- Update depatch error while remote deployment to GAE via Eclipse plugin
- Eclipse e4 Application - ContextFactory not found when included in a plugin
- Serious problems in Configuring Android SDK with Eclipse
- where can I find httpsURLConnection source code?
- Eclipse Outline View is empty
- dispose() not working. Opening new window while closing another one
- Eclipse runs out of handles
- java.lang.UnsatisfiedLinkError: Couldn't load aacdecoder from loader
- how to add my own templates to eclipse in play! framework editor
- java.lang.NoClassDefFoundError Re-Building classes in Eclipse
- Project Variables in Eclipse Post-Build Script
- NanoHTTPD: How do I add it to a current Java eclipse project and use it?
- PyDev Search doesn't work properly on Eclipse