Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » java.lang.NoSuchFieldError: resources - Eclipse AST parser error
java.lang.NoSuchFieldError: resources - Eclipse AST parser error [message #1306634] Mon, 21 April 2014 04:19
Pradeep Simha is currently offline Pradeep SimhaFriend
Messages: 6
Registered: February 2013
Junior Member
I am trying to use Eclipse's AST parser as a standalone to parse Java source files. This is a small snippet of a code to get the compilation unit:
    public CompilationUnit getCompilationUnit(ASTParser parser) {
		parser.setResolveBindings(true);
		CompilationUnit cu = (CompilationUnit) parser.createAST(null);
		return cu;
	}


If I try to execute this code standalone ie without Eclipse IDE, I am getting below error:

    java.lang.NoSuchFieldError: resources
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2545) [org.eclipse.jdt.core_3.8.2.v20120814-155456.jar:]
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:2423) [org.eclipse.jdt.core_3.8.2.v20120814-155456.jar:]
	at org.eclipse.jdt.core.dom.ASTConverter.convert(ASTConverter.java:534) [org.eclipse.jdt.core_3.8.2.v20120814-155456.jar:]


I am not understanding from where does it's calling method `resources`. If I try to run from Eclipse IDE it works without any issues. I have included following JAR files in the classpath:

    org.eclipse.core.contenttype_3.4.200.v20120523-2004.jar
    org.eclipse.core.jobs_3.5.300.v20120912-155018.jar
    org.eclipse.core.resources_3.8.1.v20121114-124432.jar
    org.eclipse.core.runtime_3.8.0.v20120912-155025.jar
    org.eclipse.equinox.common_3.6.100.v20120522-1841.jar
    org.eclipse.equinox.preferences_3.5.1.v20121031-182809.jar
    org.eclipse.jdt.core_3.8.3.v20130121-145325.jar
    org.eclipse.osgi_3.8.2.v20130124-134944.jar


I have included all of the necessary jar files to run successfully. But when I run this error occurs. Can anyone please guide me?
Previous Topic:How to show the title of a standalone view?
Next Topic:Automatically attach sources to dependencies
Goto Forum:
  


Current Time: Fri Mar 29 07:40:46 GMT 2024

Powered by FUDForum. Page generated in 0.02441 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top