2

I am tasked with deploying an old Eclipse RCP (Java 1.6) application with minimal or no changes to the code on macOS Mojave 10.14 64bit. The application hasn't been deployed in a long while, the last target was Mac OS X Snow Leopard 10.6.

The prime issue I have is that best results (full feature set) were obtained when changing the compile level of the app to Java 1.7, and circumventing this bug (where Mac complains no java is present when the JDK or JRE 1.7 or 1.8 was indeed correctly installed).

mac bug message about missing java when java isn't missing

Bug report:

Thanks to this hack:

which only functions if you have the JDK installed, not the JRE. However this being a corporate shipping, the client would never accept the pre-requisite being the JDK when it should be the JRE.

As you can see from my comment on the answer, I've tried a bastardised application of this solution on the JRE by modifying what I thought where the equivalent files and paths, but this did not work.

So, to sum up the situation

What I have

The app will run if I:

  1. Install the JDK

  2. Apply this: https://apple.stackexchange.com/a/211033/324385

What I would like

For the application to start when I've:

  1. Only installed JRE 1.7 or 1.8

  2. Applied X fix that you suggest to me

Nimesh Neema
  • 51,809
tatsu
  • 179
  • re JDK and JRE post 1.6. The JRE is just for web apps. Oracle messed up the naming. What is the exact reason you can't use the JDK? Also the more usual fix is to embed the Java VM in the app. ALso Java 7 is well past end of life from April 2015 so you are risking security issues. – mmmmmm Jul 04 '19 at 09:56
  • unfortunately I am not authorized to modify the code to that extent. I cannot embed the VM into the deployed app. so I'm forced to provide it with a VM client-side. About the Java 7, I'm fine with using Java 8 (at least for the VM), the code refuses to migrate that far. but the security thing is a non-issue. This app is meant for the army, does not require a connection to the internet to function and runs on Macs that are isolated from the internet. – tatsu Jul 04 '19 at 10:03
  • You need to speak to your manager and discuss the issues. The rules do need changing G and it might be there is some way to go that. – mmmmmm Jul 04 '19 at 12:29
  • Note that adding the jre to the app is not much if a change possibly just copying files but could well be less change than installing a jre which requires root access. – mmmmmm Jul 04 '19 at 12:30
  • you can really do that? I imagine it's not as easy as copying it in somewhere, there needs to be pointers to it in the launcher or something of the sort and the build process (which is in ANT) needs to keep these files instead of filtering them out. as for convincing my manager, I already tried that. – tatsu Jul 04 '19 at 13:05
  • See Java 8 docs https://docs.oracle.com/javase/8/docs/technotes/guides/deploy/self-contained-packaging.html#BCGIBBCI but note licensing of Oracle Java 8 - might be better to look at OpenJDK 11 – mmmmmm Jul 04 '19 at 13:09
  • this isn't a javaFX application this is an eclipse RCP one and a really mature one at that, I'm not sure that doc applies. – tatsu Jul 04 '19 at 13:32
  • he first line says "A self-contained application contains your Java or JavaFX application and the JRE needed to run the application." so not JavaFX specific - googling will give many more examples and details – mmmmmm Jul 04 '19 at 13:48
  • okay I'll look more into this solution. what says the same bug doesn't occur for self-contained JVM, though? like really what assurance do you have? – tatsu Jul 04 '19 at 13:51
  • Well you have a JRE so should not but even if you do have a bug you now have a maintainable/supported base to begin with – mmmmmm Jul 04 '19 at 15:48
  • that's not what I mean. did you follow the java bugtracker link? there's a REAL java bug with java 7 and 8 for mac where apps will not run unless you install mac 6 Legacy made by mac. this bug was never patched. for java 7 and 8. it was patched for java 9 and up. my assumption is that onboard or offboard JVM, that bug will be present. – tatsu Jul 04 '19 at 15:56
  • There is a reason only to use supported versions :) IUf not then choose what set of issues to solve. If you use Oracle 8 I would also check with legal to see what license you can use. – mmmmmm Jul 04 '19 at 19:03
  • look it's a 10 year-old project the client is the army, I think you don't understand the context here. of course I'd prefer to use java 12, heck C++, but they're not going to listen to my whims. and they need it running on new macs yesterday. I'm not about to propose a java migration or recode of this project, a project which by the way, constantly has the n+1 and n+2 versions in development because of how long the deployment and lifecycles are. – tatsu Jul 04 '19 at 21:04
  • Fine - you then have to deal with the Java 8 bug. There is no simple answer - you need to tell your management that it is more complex and need to plan a project. – mmmmmm Jul 04 '19 at 21:14

0 Answers0