Search code examples
javaeclipseparametersjavadoc

How can I see the argument names of foreign Java classes in the Eclipse tooltips and autocompletion?


Essentially, after compiling utility jars w/ ANT, I'm having the problem that all the parameters are showing up in Eclipse's tool-tip as arg0, arg1 etc.

For example:

public void myMethod(String name, String address)

After being compiled into a jar file shows up as

public void myMethod(String arg0, String arg1)

For some methods, which take a significant number of parameters, this can make them quite difficult to use. How can I keep my parameter names when compiling using ANT?


Solution

  • You will have to attach the source files to the binary jar.
    Under Referenced Libraries right click on the jar file, go to Properties, then Java Source Attachment.