• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

problem with jar file

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic