1

I have a class library which is compiled with JDK 1.7 It uses several 1.7 features and classes and would be very difficult to get it recompiled in JDK 1.5.

This needs to integrate with an old legacy application with is currently running on JRE 1.5. The integration itself will be quick because the library has just 1 class and very little methods which need to be called from the application. The application owners aren't ready to move to Jre 1.7 immediately.

What are my options here? Is there a way to quickly convert the library into a Server on which the methods can be called remotely by the application? Are there any frameworks available to get this up and running quickly? I don't want to spend too much time on this because the application will move to 1.7 in a years time and this is a stop gap thing for the meantime.

Is there a better way to do this?

  • 1
    Have you looked at options to convert your library into a RESTful server with a simple API? – raptortech97 Nov 19 '14 at 3:17
2

In my experience there are relatively few difficulties involved in taking a java 1.5 application and running it on a later vm. Java is generally quite good at maintaining backward compatibility, and the few parts that are not compatible between versions are mostly well separated into the sun.* package hierarchy.

I would therefore aim to migrate the legacy application to a modern vm as soon as possible. There is little to be gained by delaying when it is likely to be a simpler job than the one you are proposing now.

  • I don't own the legacy application and it's not my decision to make. – user93353 Nov 18 '14 at 7:47
  • Still, it is definitely worth pointing out to the owners that their decision to delay what ought to be a relatively simple project is incurring additional expense now. – Jules Nov 18 '14 at 7:50
  • All this has been done. – user93353 Nov 18 '14 at 8:02
  • write an email with arguments, make some presentations, and convince people in charge to migrate. Or quit your job :) Or suffer. – c69 Dec 19 '14 at 9:15
0

Why don't you write a bridge? Something that uses shared memory or something similar. Looking at your options, I am not sure, how fast this thing is supposed to work. But that's the only alternative I can think of.

Googling tells me this won't be easy either... Unless you use imq or something...

Methods to share memory or state across JVMs? still not easy

  • 1
    It is a good idea to copy some of the more relevant portions of the linked page's content to the answer as the links can and often do change or disappear. – Adam Zuckerman Nov 19 '14 at 1:42
0

I don't get it.

It uses several 1.7 features and classes and would be very difficult to get it recompiled in JDK 1.5.

Okay. To backport a library may be a big (expensive) task. But on the other hand, you say:

The integration itself will be quick because the library has just 1 class and very little methods which need to be called from the application.

So, why not simply port the parts you need and leave the rest out? 1 class and some methods sounds like work for an afternoon.

The application owners aren't ready to move to Jre 1.7 immediately.

But, they are aware, that the current Java Version is 8? And they are also aware of the fact, that the JVM improved a bit since Java 5? Despite the fact, that it isn't your decision, as a responsible programme who cares, you should inform the decision makers.

1.7 in a years time and this is a stop gap thing for the meantime.

Why not port it directly to Java 8?

What are my options here? Is there a way to quickly convert the library into a Server on which the methods can be called remotely by the application? Are there any frameworks available to get this up and running quickly?

Hm. There is an easy solution: http://projects.spring.io/spring-boot/ which does exactly that.

Spring Boot is easy to set up. Define some custom routes, which map to your lib. You write and deploy Spring Boot together with the library on a JDK 1.7 box and call over from the other machine. Done.

  • The class uses JAX-WS 2.5 created stubs - hence cannot be easily ported to JRE 1.5. – user93353 Nov 19 '14 at 9:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.