Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JVM considers some old version of the JAR though there is a new one

Reply
Thread Tools

JVM considers some old version of the JAR though there is a new one

 
 
Raga
Guest
Posts: n/a
 
      10-14-2006
Hi,

I have a jar file called DataProcess.jar.I ran it.Then, I made some
modifications to it, then formed the JAR file again & replaced the old
jar with the new one. I renamed the old jar to "DataProcess.jar.orig".
I also put it in a different folder outside the classpath. But JVM
still seems to take the code from the old jar file or, I shd say, it is
still executing the old code, & not at all considering the new jar
file. Is it taking from some cache or something like that? If yes, how
do I clear the cache?

To execute the jar, I do this:
1. Created a .bat file & inside it, wrote:
java -classpath DataProcess.jar;<other jar files>
package1.mainDataClass
2. Then, I executed this .bat file.

I removed the jar (to see if JVM is atleast taking it from that
location or if there is some other jar file which it is referring to).
Now, if I execute the .bat file, JVM says it cant find the class. So,
it seems to refer to the jar in the correct location only. But, the
code from that jar doesn't seem to be executed. Am saying this, bcos I
gave some println stmts in the code & it's not getting executed.
Whereas if I do this in a different machine, it works fine, meaning in
a different machine, JVM cleanly recognizes the new JAR.
Am using JDK 1.5.

Please suggest as to how to make the JVM execute the code in the new
jar file?

Thanks.

 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      10-14-2006
Raga wrote:
.....
> To execute the jar, I do this:
> 1. Created a .bat file & inside it, wrote:
> java -classpath DataProcess.jar;<other jar files>
> package1.mainDataClass


rem java -classpath DataProcess.jar;... package1.mainDataClass
java -jar DataProcess.jar -classpath DataProcess.jar;...
package1.mainDataClass

HTH

Andrew T.

 
Reply With Quote
 
 
 
 
Chris Uppal
Guest
Posts: n/a
 
      10-16-2006
Raga wrote:

> I have a jar file called DataProcess.jar.I ran it.Then, I made some
> modifications to it, then formed the JAR file again & replaced the old
> jar with the new one. I renamed the old jar to "DataProcess.jar.orig".
> I also put it in a different folder outside the classpath. But JVM
> still seems to take the code from the old jar file or, I shd say, it is
> still executing the old code, & not at all considering the new jar
> file. Is it taking from some cache or something like that? If yes, how
> do I clear the cache?
>
> To execute the jar, I do this:

[...snipped...]

Your tests seem to have been carefully thought out, and (unless you made a
mistake somewhere without realising it -- which is sadly easy to do) so it
seems that the JAR's must be correct.

Unfortunately, there is no caching of classfiles loaded from JARs in the
standard JVM implementations (well, actually there is in a way, but that's not
relevant here since it's not used for user-supplied JARs).

So I suspect that you've made the same mistake as everyone makes from time to
time, and put the wrong classfiles into the JAR you are testing.

-- chris


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Where to get stand alone Dot Net Framework version 1.1, version2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? MowGreen [MVP] ASP .Net 5 02-09-2008 01:55 AM
Re: Where to get stand alone Dot Net Framework version 1.1, version 2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? PA Bear [MS MVP] ASP .Net 0 02-05-2008 03:28 AM
Re: Where to get stand alone Dot Net Framework version 1.1, version 2.0, version 3.0, version 3.5, version 2.0 SP1, version 3.0 SP1 ? V Green ASP .Net 0 02-05-2008 02:45 AM
Hi I am new to asp i can not get it to work on xp pro sp2 even though the localhost work but asp pages dont so can some one help craig dicker ASP .Net 9 07-07-2005 11:52 AM
OT:Georgia considers banning 'evolution' jfigueredo MCSE 45 02-02-2004 04:09 PM



Advertisments