• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jar files and their parameters

 
Amstrong Huang
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, and thanks for any help you can offer me

The background for my question is that we are creating some jar files where I work, so we can reuse some code on many projects... the problem is that once i add the jars to the classpath, and i try to use the methods i have in the jars, the parameters my method receives have their names changed.

for example the original method is:
public static void send(HashMap<String, Object> parameterMap,
String template, String smtpServer, String smtpUsername,
String smtpPassword, Boolean auth, Boolean tls) throws MailNotSentException {
//code here
}

but when i try to use it on another project what i get is:
Class.send(arg0, arg1, arg2, arg3, arg4, arg5); and not the original parameter names

this is using Eclipse ganymede, not sure if the IDE has something to do with the parameter names being changed.

i also have it documented with javadoc comments, and i was wondering if there is a way that the things i write in the comments, appear.
I mean like when you use Eclipse and write String then press Ctrl + Space the suggestions appear, but some have extra information on a yellow box

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34860
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it has to do with the compiler settings - as to whether the parameter names are remembered or not.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, I think you'd have to compile with debug symbols turned on in order for that info to be preserved in the jar.
 
Amstrong Huang
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the help, actually didnt quite discover how to do it with the javac command, but found another way... well at least works in eclipse and that's what we are using here.

the way we did it is:
right click on your project, then java build path, then you see the list of jars, then you extend the jar you want and you can see a javadoc option, double click it, then you point it to your generated javadoc.

It works for us because we made a jarRepository project where we are uploading all the jars and their javadocs, so we just point the jars to the javadocs from our local server

hope it helps someone else
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic