0

For a university assessment we're doing a large java project which makes use of a given external hardware that utilises a given java library to interact with it.

The main problem is that such java library only runs on java 1.8 (the reason is not clear yet) and just fails with newer versions of java.

Since the rest of the code (a few thousands) is written in java 9, it's obviously a hard task to rewrite everything without making uses of all the functionalities added since java 1.8

I have the following questions:

  • Is there a way to make the whole project back-compatible without changing thousands of lines of code? (or to make the library work with a newer version of java)
  • In the case there isn't such way, is there an easy way to see what needs to be changed to make the project compatible with a previous version of java?

Thank you in advance for any answer, any small contribution will be a great deal for us

Error stack trace:

# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000180005b00, pid=20224, tid=10952
#
# JRE version: Java(TM) SE Runtime Environment (9.0+11) (build 9.0.4+11)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (9.0.4+11, mixed mode, tiered, compressed oops, g1 gc, windows-amd64)
# Problematic frame:
# C  [rxtxSerial.dll+0x5b00]
#
# No core dump will be written. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\works\Documents\GitHub\Software-Engineering\src\hs_err_pid20224.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
MathT
  • 65
  • 7
  • 6
    It isn't clear what new "functionalities" you believe you have used that are new. Try compiling with `-target 1.8` and `-source 1.8` and see what happens. – Elliott Frisch Mar 08 '18 at 11:47
  • 1
    If you can provide the name of the library or a stack trace or something it would be easier to help you. There are some known issues, but it is hard to say which one applies to you. – ewramner Mar 08 '18 at 11:47
  • Which jar? We usually use bamboo for deployment which takes care of compatiblity for stuff. – Mahesh Karia Mar 08 '18 at 11:47
  • 3
    "*such java library only runs on java 1.8*" => what happens with Java 9? You may be able to fix the issue with a few settings. – assylias Mar 08 '18 at 11:57
  • I'm voting to close this question as off-topic because it is a homework – Vy Do Mar 08 '18 at 12:11
  • Ask the library vendor. Sometimes they felt at the end of time, and wanted to ensure, their library isn't used with 1.7 and check for 1.8 explicitly, without thinking of later versions. – user unknown Mar 08 '18 at 12:21
  • 2
    @ElliottFrisch better `--release 8`… – Holger Mar 08 '18 at 12:26
  • And the library is called RXTXcomm – MathT Mar 08 '18 at 12:27
  • As for the new functionalities we're using many different generics types, some of which weren't introduced in java 1.8. – MathT Mar 08 '18 at 12:31
  • I think if its a homework, its still not an argument to close it.. But.. I didnt got what is the problem .. Its not throwing an error according to your lib, but to some dll lib, maybe in `C:\Users\works\Documents\GitHub\Software-Engineering\src\hs_err_pid20224.log` you will find more relevant output. And pasted error message is from where? Bamboo as you mentioned? With which parameters did you run build ,etc... Provide better scope, please – xxxvodnikxxx Mar 08 '18 at 12:41
  • "different generics types, some of which weren't introduced in java 1.8" Name a few examples? Can you prove that this particular problem doesn't appear in Java 8? From what you've provided it at least seems possible that this has nothing to do with Java 9 at all. – Anlon Burke Mar 08 '18 at 13:55
  • You have not provided a stack trace (from Java code) but a partial core dump. Enable full core dumps and run with symbols, then you can see in detail where it crashes. It seems to crash when accessing the serial port in native (non-Java) code. Are you sure that Java 8 works on the same machine? It may be related to drivers rather than Java version? Write a minimal test that uses the serial library and run it on the same machine with Java 8 and Java 9 with core dumps enabled, please. – ewramner Mar 12 '18 at 08:25
  • Are you using the latest version of [jLog](http://jlog.org/windows.htm)? What Java 9 features are you using on your project? Did you check for [UAC settings](https://java.com/en/download/help/exception_access.xml) on the host? – Allan Wojcik da Silva Mar 17 '19 at 01:01

0 Answers0