Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-dev] How to detect or compile classes using the class I am compiling?

Hi,

I have some code that compiles Java classes (from source) using org.eclipse.jdt.internal.compiler.Compiler.

It works just fine, but the following does not work:

If Class A uses class B, then the first time I compile A, then B gets compiled.
But if I choose to recompile B, then A will not get recompiled.

This results in for instance methodNotFound when A is calling a method in B that no longer exists.

I want to
a) detect that B is used by A, so I can manually recompile A when B is recompiled
b) or, make the compiler automatically recompile A when recompiling B.

This will result in a compiler-error when compiling A instead of runtime error when calling A.

I am using org.eclipse.jdt.internal.compiler.Compiler standalone in a custom Java project.

Does anyone have any ideas about how I can achieve this?

Regards,
Morten Kjetland

Back to the top