I get 2 classes in package P
. Interface class A
and its implementation class B
.
In the file with class B
I get the following error: The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files
.
I'm using Eclipse Helios and
$ java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) Server VM (build 25.5-b02, mixed mode)
Standard solution of removing and adding JRE doesn't work. How can I fix it?
EDIT:
Code:
Class A
:
package com.jax;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
@WebService
@SOAPBinding(style = Style.RPC)
public interface WebServiceInter {
@WebMethod
String sayHello();
}
Class B
:
package com.jax; // **Error is here**
import javax.jws.WebService;
@WebService(endpointInterface = "com.jax.WebServiceInter")
public class WebServiceImpl implements WebServiceInter{
@Override
public String sayHello(){
return "Hello!";
}
}
Project structure:
ProjectName -> Java Resources -> com.jax -> Class A
, Class B
Make your Project and Workspace to point to JDK7 which will resolve the issue. https://developers.google.com/eclipse/docs/jdk_compliance has given ways to modify Compliance and Facet level changes.
Just trying to compile with ant, Have same error when using org.eclipse.jdt.core-3.5.2.v_981_R35x.jar, Everything is well after upgrade to org.eclipse.jdt.core_3.10.2.v20150120-1634.jar
"Java 8 support for Eclipse Kepler SR2", and the new "JavaSE-1.8" execution environment showed up automatically.
Download this one:- Eclipse kepler SR2
and then follow this link:- Eclipse_Java_8_Support_For_Kepler
Your Eclipse software suite doesn't support Java 1.8
Source: Stackoverflow.com