Hello everyone! :wave: I have a situation where I ...
# compiler
l
Hello everyone! 👋 I have a situation where I need to compile a fairly large Kotlin application (that I don't want to rewrite into Java!) so it can run on target version Java 1.5. I'm reading in the docs here https://kotlinlang.org/docs/compiler-reference.html#jvm-target-version that the lowest supported version (which is deprecated) is 1.6. Is it completely impossible to achieve bytecode that can run on a VM that's version 1.5? Otherwise, any ideas on how to progress without re-writing the whole thing in Java 1.5? 😬 Thank you! 🙏
p
It has been years since I used the tool, but we used to use Retrolambda (https://github.com/luontola/retrolambda) to backport Java 8 bytecode back to something we could use on Android. I have absolutely no clue how well it might work in your case, but it might be worth an experiment to see if it can re-write bytecode to run on Java 5. The big problem is that it translates language features but not the APIs you call, so there might still be a hurdle or two to jump before the finish-line
l
@psh that's a great source I haven't discovered yet, will dig around and see what we've got - thank you for the suggestion!
for completeness, we gave this a go, but the scale of our application meant that were too many hurdles for us to jump. For our particular project, we ended up running our Kotlin application on a secondary device that connected over ethernet to the device that could only run Java 1.5