Reputation: 361
My project requires the gif4j suite. So I set the classpath to "C:...\gif4j_pro_trial_2.3.jar" in the Environmental Variables window from my Control Panel. I know that when we have multiple values for classpath, you seperate them with a semi-colon. I did that too. But I'm still getting this error when I run the file.
Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problems:
The import com.gif4j.TextPainter cannot be resolved
The import com.gif4j.Watermark cannot be resolved
I don't really understand what's going on here since I'm not the one who wrote the code. What am I missing?
Upvotes: 0
Views: 241
Reputation: 114817
The throw new Error(..()
statement has been created by eclipse. Whenever eclipse can't compile a class because of compile time errors in methods, it tries to create stubs for those methods. So you'll always find a class file, even if the source code has errors.
Such a method would look like (example):
public long calculate(long a, long b) {
throw new Error("Unresolved compilation problems"); // + additional information
}
It doesn't actually exist in your source, it's only created on byte code level.
So, what has happened: Most likely that you (or someone else) ignored error markers in your project and now tried to use the class files in the bin
folder. You can't fix that problem at runtime, you have fix the project to create properly compiled classes.
Upvotes: 1
Reputation: 20939
This error doesn't say anything about not being able to find the gif4j classes at runtime. Instead, it's saying that, when the code was compiled, those classes weren't available. javac
does not produce these kinds of errors (instead it simply fails to compile), so I'm assuming this code was compiled by Eclipse. In that case, you should check your Eclipse project configuration and make sure that the gif4j libraries are properly included there.
Upvotes: 1