Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Backward Compatibility(Failing to get executable jar files to open on other computers due to differences in Java versions)
Backward Compatibility [message #1805921] Sun, 28 April 2019 07:25 Go to next message
Patrick Moran is currently offline Patrick MoranFriend
Messages: 143
Registered: March 2018
Senior Member
As versions of Eclipse change, it seems that versions of the JRE installed on one's computer must sometimes be changed to keep up with Eclipse. It also seems that Java programs produced using a later system will not work on the computer of somebody who else who is either running a JRE that is too early or else is running the latest JRE, one that happens to be later than the one I have been using for most of the last year.


Are things really this discombobulated? Or am I missing something.

When I was doing C programming for the Macintosh, Apple tried very hard to maintain backwards compatibility. Except the the change around OS4, nothing ever changed so drastically that I had to rewrite code to keep up with Apple. Some of my stuff continued to work for several years. On the other hand, companies such as Code Warrior would make major changes from year to year, so that besides having to buy a new version of their software I also had to do massive re-writes of header files to make them comply with the new standards incorporated in the latest compiler.

With Eclipse, moving a complicated project from one version to another version was something I could not successfully do without bringing the old Workspace folder and all of its hidden files over with it. Somehow that facilitated the transfer. Just copying old code to new folders for the new version of Eclipse seemed not to work at all.

For the last few months I have been using 10.0.2, which Java has decided has major security flaws and so forth and is never to be used again. However, if when I got a new computer and decided to install 12.something since it was the latest thing available from Oracle at that point, nothing would work right, and I remember having a good bit of trouble scrubbing away all of the stuff associated with version 12, and then getting 10.0.1 out of Java purgatory, and probably doing some stuff with Eclipse to make sure it knew which version of the. JRE it was trying to work with.

If I make my new stuff available to colleagues to try, sending things out as JAR files, I have an idea that they almost universally will be running something other than 10.0.2.

With Mac software, it typically will work for years. I am running versions of their spreadsheet program that go back to something like 2008. Typically, if I buy something such as GraphicConverter to draw my illustrations with, it will keep working despite Mac OS changes, or else they will give me a free update.

It's beginning to look to me as though with Java, the consumer has to negotiate with or adapt to the software producer as to which JRE the software is for and/or negotiate with or adapt to the degree of flexibility of Oracle on (1) making their stuff backward compatible (which I don't think they care much about) and/or (2) being able to get the right old version for them, and/or (3) there being some way in which one can keep several versions of JRE on the same computer and somehow manage to connect the Java programs to the appropriate JRE versions.

Am I making things too complicated? Is it really not this chaotic? If I've got it approximately right, where can I find a good strategy for software maintenance. It looks like I may have to rewrite my source code every year or so and recompile for the version of Java that Oracle ships out as SOP.
Re: Backward Compatibility [message #1805922 is a reply to message #1805921] Sun, 28 April 2019 07:59 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30314
Registered: July 2009
Senior Member
Yes, things are a bit of a mess for several reasons. Of course it's reasonable that Eclipse itself starts using new versions of Java to use new language features, e.g., lamdas. So at this point Eclipse requires Java 8. But all the older versions of Java are past end-of-life, so that seems not at all unreasonable. It takes some legwork to even find an older version of Java to install.

The other problem is that newer versions of Java have been rather disruptive with respect to being truly compatible with older versions. E.g., the way reflection has changed with the introduction of modularization. This has had the effective of older versions of Eclipse or (many other applications) not working on Java 9. Now Java 11 has made access to javax packages more of a challenge, again creating compatibility problems. So yes, to my mind, it's a bit of a mess. :-(
Re: Backward Compatibility [message #1806055 is a reply to message #1805922] Wed, 01 May 2019 17:40 Go to previous messageGo to next message
Patrick Moran is currently offline Patrick MoranFriend
Messages: 143
Registered: March 2018
Senior Member
I need to go over the sequence of events, but beginning with the Eclipse-provided instructions:
"Try the Eclipse Installer 2019-03R
Windows 64 bit" and then
"You will need a Java runtime environment (JRE) to use Eclipse (Java SE 8 or greater is recommended)," I started feeling like a kitten in a dryer.

As near as I can tell, it is a mistake to use Java 11 or Java 12. For one thing, they do not come with a JRE. The oldest JRE seems to be for Java 8. On Stackoverflow, I found Stackoverflow.com/questions/5671412/errir-a-jni-error-has-occurred-...
The expert responding to a long plea for help says:
"You've compiled for Java 11 ... but you're running an older JRE (Java 8)..... Upgrade your target JRE to Java 11."

I've found something on AdoptOpenJDK that may work as a JRE 12, but it's taken me a full day's work to get this far, going over and over the instructions on Eclipse, trying to do everything right. And on top of everything else, it seems that most people who would possibly use my software would not be able to make it work on a vanilla setup for Java use just to run programs.

I'll attach my rough notes that I tried to keep as I worked on my Windows computer and kept track of things on my Mac. It's not perfect, but I'm at the point that I feel like I may need to scrub everything of that HP and start from as "as new" configuration.



Re: Backward Compatibility [message #1806109 is a reply to message #1806055] Thu, 02 May 2019 17:42 Go to previous messageGo to next message
Patrick Moran is currently offline Patrick MoranFriend
Messages: 143
Registered: March 2018
Senior Member
I've set my copy of Eclipse (on my Mac) to compile for Java 8. I have reinstalled all Java files on my HP and yet I keep getting a "jni" file error.

I have seen a fair number of cases of other people getting this error, but mostly convoluted solutions involving the particular software trying to use Java, and nothing that seems to apply to my case.

I can't tell whether there is really something missing on my HP or whether there is something set up wrong on my copy of Eclipse. However, every time I try something new I've run these programs on an older Mac that is running Java 10, which is what my newer Mac is using. So maybe the two alterations I've made to the Eclipse compiler are not really doing their job. Or maybe there is something else I need to change. Right now I'm totally lost.
Re: Backward Compatibility [message #1806116 is a reply to message #1806109] Thu, 02 May 2019 21:43 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 3439
Registered: July 2009
Senior Member

Patrick Moran wrote on Thu, 02 May 2019 13:42
I've set my copy of Eclipse (on my Mac) to compile for Java 8. I have reinstalled all Java files on my HP and yet I keep getting a "jni" file error.

What's the actual error message?


Nitin Dahyabhai
Eclipse Web Tools Platform
Re: Backward Compatibility [message #1806192 is a reply to message #1806116] Sun, 05 May 2019 18:53 Go to previous message
Patrick Moran is currently offline Patrick MoranFriend
Messages: 143
Registered: March 2018
Senior Member
Java Virtual Machine Launcher
Error: A JNI error has occorred. please check your installation and try again.
Previous Topic:"An error has occurred. See the log file..."
Next Topic:Missing Environment tab in Debug Configuration window
Goto Forum:
  


Current Time: Tue Jul 23 02:37:21 GMT 2019

Powered by FUDForum. Page generated in 0.02632 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top