Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

Converting source 1.5 > 1.4

Thread view: 
VisionSet - 07 Nov 2005 11:16 GMT
I don't suppose anyone knows of a tool that can convert from 1.5 to 1.4
code?
Seems a strange request, but I have case tools that only work with 1.4.

TIA
--
Mike W
asaguden - 07 Nov 2005 11:29 GMT
No, actually I dont.

But - maybe you know that you can compile (1.4 and 1.5) your source
with parameters
'src' and 'target', where src is the Java source version and target is
the target supported Java version.

In your case:
compile the source (in java 1.5) to target 1.4 or src and target both
for 1.4, then the
compiler ought to give you info on what to change.
In Eclipse (and others?) editor you can compile in runtime, which makes
the job easier.

It is not automatically writing your code, but the job gets done.

Good luck
Peter
__________________________________________________________
> I don't suppose anyone knows of a tool that can convert from 1.5 to 1.4
> code?
[quoted text clipped - 3 lines]
> --
> Mike W
Thomas Hawtin - 07 Nov 2005 15:27 GMT
> In your case:
> compile the source (in java 1.5) to target 1.4 or src and target both
> for 1.4, then the
> compiler ought to give you info on what to change.

-source 1.5 -target 1.4 will not work.

>>I don't suppose anyone knows of a tool that can convert from 1.5 to 1.4
>>code?
>>Seems a strange request, but I have case tools that only work with 1.4.

I think Roedy was hinting at Retroweaver (for class files). I tried it
sometime ago and seems to work quite well.

Tom Hawtin
Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/

Roedy Green - 07 Nov 2005 15:39 GMT
On Mon, 07 Nov 2005 15:28:55 +0000, Thomas Hawtin
<usenet@tackline.plus.com> wrote, quoted or indirectly quoted someone
who said :

>I think Roedy was hinting at Retroweaver (for class files). I tried it
>sometime ago and seems to work quite well.

thanks. that is what I was trying to think of.  see
http://mindprod.com/jgloss/retroweaver.html

I have added links to it from the javac.exe and jdk entries so I hope
I can find it again when the name slips again.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Roedy Green - 07 Nov 2005 11:37 GMT
>I don't suppose anyone knows of a tool that can convert from 1.5 to 1.4
>code?
>Seems a strange request, but I have case tools that only work with 1.4.

Stripping generics should be easy.  just yank stuff <xxx>.  Everything
still works just the same because of type erasure.

To get rid of Enum is harder. You would have to create an Eunum class
that behaved much like Sun's.  You would then decompile the 1.5 code
with JAD and use the result as 1.4 code.

I have heard people mention some tool Nostalgia, TheGoodOldDays --
something like that.  Someone will surely mention it, that lets you
retrofit 1.5 code to 1.4 JVMs.

Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Daniel Dyer - 07 Nov 2005 11:55 GMT
>> I don't suppose anyone knows of a tool that can convert from 1.5 to 1.4
>> code?
>> Seems a strange request, but I have case tools that only work with 1.4.
>
> Stripping generics should be easy.  just yank stuff <xxx>.  Everything
> still works just the same because of type erasure.

You would most likely have to insert a number of explicit casts as well,  
and possibly some boxing/unboxing code if you have used the primitive  
wrapper classes with your generics.

Dan.

Signature

Daniel Dyer
http://www.dandyer.co.uk



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.