Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Changing function prototype generates "cannot resolve" error.
Changing function prototype generates "cannot resolve" error. [message #911944] Wed, 12 September 2012 16:16 Go to next message
Mason Wardle is currently offline Mason WardleFriend
Messages: 6
Registered: September 2012
Junior Member
I have two projects in Eclipse. One of them is a plugin that contains a class that is essentially a plotter and that extends org.eclipse.ui.part.ViewPart.

I am instantiating this plotter class from the other non-plugin project. I have something in the project that makes it so a class from the "other" project cannot call member functions from the plotter class that expect at least one String passed to them.

For example, the following code snippet:
Plotter myPlotter = new Plotter();

myPlotter.plot();

works correctly. The plot does exactly what I expect. If, however, I modify plot to expect a String (say, for a label), or even create a new function that prints a String:

Plotter myPlotter = new Plotter();
String theString = "I'm the String";
myPlotter.plot(theString);
myPlotter.printMe(theString);


Eclipse gives me the red underlines under printMe and plot. When I hover over printMe, I get the error:
The type org.eclipse.ui.part.ViewPart cannot be resolved. It is indirectly referenced from required .class files

I think it's a compiler mismatch. When I first starting running this instance of eclipse (3.6.x), I was using Java 1.6. I got some code from a colleague that required me to go to 1.7 for the "other project". I've since made both projects use 1.7.

I think the issue lies somewhere in my project set up, but I can't shake anything loose.

Under Project: Java Compiler, I set both projects so they don't use project-specific settings. That didn't work. When I enable project-specific settings, one of my projects has Use compliance from execution environment on Java Build Path grayed out and unchecked, but the other project has it checked and not grayed out.

On the Java Build Path, I have the same JRE System Library (jdk1.7.0_03) for both projects.

Any ideas? Am I barking up the wrong tree and it's a totally different issue?

Re: Changing function prototype generates "cannot resolve" error. [message #911951 is a reply to message #911944] Wed, 12 September 2012 16:33 Go to previous messageGo to next message
Mason Wardle is currently offline Mason WardleFriend
Messages: 6
Registered: September 2012
Junior Member
I've built another two classes in the plugin project to test the issue, one whose superclass is java.lang.Object, the other from org.eclipse.ui.part.ViewPart. I can call functions with String in them from the former class but I cannot call functions with String in the from the latter class. So it has something to do with ViewPart, and may or may not be related to my project setup.
Re: Changing function prototype generates "cannot resolve" error. [message #911957 is a reply to message #911951] Wed, 12 September 2012 16:46 Go to previous message
Russell Bateman is currently offline Russell BatemanFriend
Messages: 3798
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 9/12/2012 10:33 AM, Mason Wardle wrote:
> I've built another two classes in the plugin project to test the issue,
> one whose superclass is java.lang.Object, the other from
> org.eclipse.ui.part.ViewPart. I can call functions with String in them
> from the former class but I cannot call functions with String in the
> from the latter class. So it has something to do with ViewPart, and may
> or may not be related to my project setup.

My impression was already that it's a Java question. I'd suggest
javaranch.com or stackoverflow.com. You'll get kind help pretty fast in
both places.
Previous Topic:(java) automatic save while git committing
Next Topic:Search results not showing in some perspectives
Goto Forum:
  


Current Time: Tue Apr 23 12:13:24 GMT 2024

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

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

Back to the top