Try closing and re-opening the file.
It is possible to get this error in eclipse when there is absolutely nothing wrong with the file location or package declaration. Try that before spending a lot of time trying these other solutions. Sometimes eclipse just gets confused. It’s worked for me on a number of occasions. I credit the idea to Joshua Goldberg.
Related Contents:
- How to import a jar in Eclipse?
- Access restriction on class due to restriction on required library rt.jar?
- How to run eclipse in clean mode? what happens if we do so?
- Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved
- Error: Selection does not contain a main type
- Runnable JARs missing Images/Files (Resources)
- Integrating tomcat and eclipse as a hot-deploy environment
- org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 15
- Hidden features of Eclipse [closed]
- SQLite in Android How to update a specific row
- Eclipse cannot load SWT libraries
- How to create war files
- The type java.lang.CharSequence cannot be resolved in package declaration
- Create a Maven project in Eclipse complains “Could not resolve archetype” [duplicate]
- Eclipse is confused by imports (“accessible from more than one module”)
- Eclipse Kepler for OS X Mavericks request Java SE 6
- Java properties UTF-8 encoding in Eclipse
- Countdowntimer in minutes and seconds
- Java equivalent to #region in C#
- How to create a project from existing source in Eclipse and then find it?
- How to use conditional breakpoint in Eclipse?
- Eclipse/Maven error: “No compiler is provided in this environment”
- Import XXX cannot be resolved for Java SE standard classes [duplicate]
- Eclipse command line arguments
- Eclipse – debugger doesn’t stop at breakpoint
- How to attach source or JavaDoc in eclipse for any jar file e.g. JavaFX?
- Lombok is not generating getter and setter
- Getting ‘java.lang.UnsatisfiedLinkError’: no lwjgl in java.library.path
- Where is the correct location to put Log4j.properties in an Eclipse project?
- Eclipse memory settings when getting “Java Heap Space” and “Out of Memory”
- Embedding resources (images, sound bits, etc) into a Java project then use those resources
- Android Unable to instantiate activity: Didn’t find class on path
- java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
- Android Geocoder getFromLocationName always returns null
- Eclipse logcat debugging
- Find unused classes in a Java Eclipse project
- Android drawable speech bubble
- Hot swapping in Spring Boot
- How do I run Eclipse using Oracle’s new 1.7 JDK for the Mac?
- How to solve maven 2.6 resource plugin dependency?
- NoClassDefFoundError on external library project for Android
- Eclipse – module not found when adding module-info.java
- Why can’t I use Resources.getSystem() without a Runtime error?
- Paste a multi-line Java String in Eclipse [duplicate]
- R.raw.anything cannot be resolved [duplicate]
- How to package resources in Jar properly
- Java Regex pattern that matches in any online tester but doesn’t in Eclipse
- Eclipse: How to install a plugin manually?
- How to reference javadocs to dependencies in Maven’s eclipse plugin when javadoc not attached to dependency
- error: unable to load installed packages just now