• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with jar file  RSS feed

 
Rakesh Gadre
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I am using Eclipse and have 2 projects in it.
I create a jar file of project1 and use it in project2.
The jar file of project1 is added in the path of project2.

Now, the problem..

I have added some new code in one of the java programs of project1.
The jar is created as usual.

If i try to access the newly added code from project2, I get No Such Method exception..

If I expand the jar file from eclipse, I see the new function.
If I decompile the respective class file, I see the new code.
If I use reflection package and print the method names, I DO NOT SEE the enw method..

I am really confused and not sure where the problem is..

I am using JDK1.4, Eclipse 3.1, ANT 1.6.5

Thanks in advance

Rakesh
 
Chintan Rajyaguru
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had a similar problem in Rational Application Developer, which I fixed by simply restarting the IDE. Here are a few questions for you

1. Do you export project1 as a jar file and add external jar for project2?
2. If yes to above, do you reexport project1 after changing it?
3. If yes to above, do you refresh project2?

In general, I would recommend not to add project1 as jar file in eclipse. Use project dependency to make your code compile, when you exprt project1 and project2 to run within a server, make sure project1.jar is in classpath of project 2
 
Rakesh Gadre
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chintan,

I am not creating jar file using eclpse, I am using ANT script to do that. I add the jar file in project build path.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!