Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Downgrade Java code 1.5 to 1.4 (bonus points: J2ME, Blackberry!!!)

I want to port some existing j2se libraries (e.g. Apache Compression libs) to use for Blackberry development, but there is a catch (and not just one).

First, most java libs extensively use j2se collections and data types that are typically missing on j2me platforms — but that's theoretically solvable thanks to open-source j2se api implementations like Apache Harmony. The bigger problem is that, it seems, Blackberry JDK is based on java 1.4, so any code that uses generics and other 1.5 features, like Enums, is not effortlessly compilable on Blackberry.

Which raises an interesting question of whether there are any existing tools or projects out there that would do automatic 1.5->1.4 conversion, while supporting j2me-bastardized bytecode :)

One project I was able to find is Retroweaver, but I'm not quite sure how active that project is.

I'm sure the problem of 1.5->1.4 automatic conversion isn't unique -- so does anybody have any experience with it?

like image 246
Paul Milovanov Avatar asked Jun 05 '09 22:06

Paul Milovanov


2 Answers

Have you tried Retrotranslator? I read that it does a better job than Retroweaver.

like image 97
Mihai Fonoage Avatar answered Sep 19 '22 00:09

Mihai Fonoage


Here's something else I found here on stack overflow:

Compiling with the regular javac and targeting an older JVM will give you proper bytecode for generics at least

Which absolutely makes sense to try.

like image 26
Paul Milovanov Avatar answered Sep 23 '22 00:09

Paul Milovanov