Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-dev] Get notified on runtime classpath changes

Hi Christoph,

updates of the classpath for java projects are handled within the main thread in

SetClasspathOperation(ChangeClasspathOperation).classpathChanged(ClasspathChange, boolean)

However i have no clue how to add a listener to that.
Does that help?

Jörg Kubitz

Am 03.02.2021 um 12:57 schrieb Christoph Läubrich:
Is there a way to be notified about any change on the classpath e.g.:

- class file replaced (in this or any related project)
- jar added
- maven dependency updated

I don't really care about the type or source, I just want to update some internal state whenever anything changes that could affect a previous run of a tool that uses the

String[] classPathEntries = JavaRuntime.computeDefaultRuntimeClassPath(javaProject);

to build a classloader so I know i need to refresh this. A Resourcelistener and/or builder seem to be covering much more than I need and wouldn't be specific enough so I wonder if there is anything I could use for this specific case, I assume that JDT already knows when something changes here and recompile classes as necessary...

jdt-dev mailing list
To unsubscribe from this list, visit

Back to the top