Search code examples
eclipsejavadoceclipse-jdt

How to programmatically specify JRE javadoc location in eclipse?


You can manually set it via

_Package Explorer / JRE System Library / rt.jar -> contextmenu -> properties - Attach Javadoc..

And the settings are stored in .metadata.plugins\org.eclipse.core.runtime.settings\org.eclipse.jdt.launching.prefs.

I wonder is there anyway I can programmatically specify it?

Thanks a lot!


Solution

  • Javadoc is here.

    The method you want is IVMInstall#setJavadocLocation(URL). You need to create a VMStandin from the existing IVMInstall, modify its javadoc location, then do VMStandin#convertToRealVM() which will apply the changes.

    JavaRuntime has a few methods for getting IVMInstalls.