Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > .class with JDK1.2 --> run with JRE1.4 ???

Reply
Thread Tools

.class with JDK1.2 --> run with JRE1.4 ???

 
 
qazmlp
Guest
Posts: n/a
 
      07-14-2004
Assume that, I have generated a .class file after compiling a java
program with the JDK1.2.
Is it 100% guaranteed always that, this program will run without any
problems under the JRE1.4 environment? If yes/no, why?
 
Reply With Quote
 
 
 
 
kaeli
Guest
Posts: n/a
 
      07-14-2004
In article <(E-Mail Removed) >, qazmlp1209
@rediffmail.com enlightened us with...
> Assume that, I have generated a .class file after compiling a java
> program with the JDK1.2.
> Is it 100% guaranteed always that, this program will run without any
> problems under the JRE1.4 environment? If yes/no, why?
>


No.
Because tools like this exist.
http://javaadvisor.com/doc/13054

--
--
~kaeli~
A lot of money is tainted - It taint yours and it taint mine.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

 
Reply With Quote
 
 
 
 
John C. Bollinger
Guest
Posts: n/a
 
      07-14-2004
qazmlp wrote:
> Assume that, I have generated a .class file after compiling a java
> program with the JDK1.2.
> Is it 100% guaranteed always that, this program will run without any
> problems under the JRE1.4 environment? If yes/no, why?


It depends what you mean by that. The class file format has not changed
since Java 1.0. The VMs for 1.4 will correctly run bytecode produced by
the JDK 1.2 compiler. Compatibility issues arise (a bit) when you start
looking at the platform library. As far as I am aware, nothing from the
1.2 library has been removed from 1.4, although some methods are now
deprecated.

You may run into trouble if your 1.2 classes extend classes from the
platform library or implement interfaces from the platform library.
Where a new abstract method has been added to a class or a method has
been added to an interface since 1.2, your concrete classes may suddenly
become abstract when run against the 1.4 library. I am not aware
offhand of any classes to which this would apply, but there may be some.
There certainly are some interfaces to which it applies, but none I am
aware of that are commonly implemented by user code. I can imagine some
cases in which interaction of the 1.4 classes with your code would
produce unexpected results because of new concrete methods added to the
platform classes (and unwittingly inherited by your classes), but I
think such cases are generally unlikely.

Your best bet is to actually test. If you have a unit test suite then
that's easy. If not, then maybe now is the time to write one. If you
don't want to write one then you can still test manually (and you can
look forward to future rounds of manual testing, too).


John Bollinger
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
ohaya
Guest
Posts: n/a
 
      07-15-2004


"John C. Bollinger" wrote:
>
> qazmlp wrote:
> > Assume that, I have generated a .class file after compiling a java
> > program with the JDK1.2.
> > Is it 100% guaranteed always that, this program will run without any
> > problems under the JRE1.4 environment? If yes/no, why?

>
> It depends what you mean by that. The class file format has not changed
> since Java 1.0. The VMs for 1.4 will correctly run bytecode produced by
> the JDK 1.2 compiler. Compatibility issues arise (a bit) when you start
> looking at the platform library. As far as I am aware, nothing from the
> 1.2 library has been removed from 1.4, although some methods are now
> deprecated.
>
> You may run into trouble if your 1.2 classes extend classes from the
> platform library or implement interfaces from the platform library.
> Where a new abstract method has been added to a class or a method has
> been added to an interface since 1.2, your concrete classes may suddenly
> become abstract when run against the 1.4 library. I am not aware
> offhand of any classes to which this would apply, but there may be some.
> There certainly are some interfaces to which it applies, but none I am
> aware of that are commonly implemented by user code. I can imagine some
> cases in which interaction of the 1.4 classes with your code would
> produce unexpected results because of new concrete methods added to the
> platform classes (and unwittingly inherited by your classes), but I
> think such cases are generally unlikely.
>
> Your best bet is to actually test. If you have a unit test suite then
> that's easy. If not, then maybe now is the time to write one. If you
> don't want to write one then you can still test manually (and you can
> look forward to future rounds of manual testing, too).
>



John,

My apologies for dropping in on this thread, but a couple of weeks ago,
I had posted some questions related to serialized objects (in files).
In general, wouldn't something like that be another potential problem
area, e.g., if the format of the serialized data has changed between
versions (I don't think it did between 1.2 and 1.4)?

Jim
 
Reply With Quote
 
John C. Bollinger
Guest
Posts: n/a
 
      07-15-2004
ohaya wrote:
> My apologies for dropping in on this thread, but a couple of weeks ago,
> I had posted some questions related to serialized objects (in files).
> In general, wouldn't something like that be another potential problem
> area, e.g., if the format of the serialized data has changed between
> versions (I don't think it did between 1.2 and 1.4)?


There is a potential for difficulty here if serialized objects are used
for persistent storage. Depending on the classes involved it might or
might not work. Serialization is a terrible approach for persistent
object storage, however, in part for that very reason. There is also a
potential for problems if serialization is used for object transport,
for instance in an RMI application. The Serialization subsystem has
mechanisms to address that, but it is possible (if unlikely) to run into
unresolvable difficulties when one side of the link is using a different
version of the platform library than the other side.


John Bollinger
(E-Mail Removed)
 
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
Exception in GUI Run but not in Simple RUN Andrea9 Java 1 10-20-2006 12:54 PM
What is the difference of modelsim command run -continue and run -all rxjwg98@gmail.com VHDL 2 09-05-2006 02:14 PM
Can't Run 'RUN' Windows XP Home Luke O'Malley Computer Support 2 09-01-2005 11:38 PM
can run javascript can't run vbscript - WHY duncan ASP .Net 2 10-27-2004 09:31 AM
Anybody remember, Run Buddy Run and Second Hundred Years? Tom McCafferty DVD Video 5 10-02-2004 09:15 PM



Advertisments