Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Java Version #1056

Closed
wants to merge 1 commit into from
Closed

Update Java Version #1056

wants to merge 1 commit into from

Conversation

cdennison
Copy link

@cdennison cdennison commented Feb 13, 2021

Got this error using Java 14 so updating docs to Java 15 which worked for me.

Exception in thread "main" java.lang.UnsupportedClassVersionError: me/drton/jmavsim/Simulator has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 58.0

Looks like this needs updating in the following areas - I'm happy to update the PR but I cannot test all those envs.

Got this error using Java 14

Exception in thread "main" java.lang.UnsupportedClassVersionError: me/drton/jmavsim/Simulator has been compiled by a more recent version of the Java Runtime (class file version 59.0), this version of the Java Runtime only recognizes class file versions up to 58.0
@hamishwillee
Copy link
Collaborator

hamishwillee commented Feb 16, 2021

Thanks @cdennison.

I've tidied up your suggested "things that need to be fixed".

  • Most of these are translated copies (they automatically get fixed based on the English versions).
  • The versions for other platforms (ie Linux and Windows) work with the versions of Java you get by default on those platforms. Unless that has changed (I will test) we don't want to change globally.

I'll do some testing.

@hamishwillee
Copy link
Collaborator

@julianoes Do you use MacOS and can you test this?

As a test point Ubuntu 20.04 uses Java 14. I just tested against latest PX4 in my VM. It works, though I do get some (different) warnings:

BUILD SUCCESSFUL
Total time: 1 second
Options parsed, starting Sim.
Starting GUI...
Feb 16, 2021 4:30:14 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by javax.media.j3d.JoglPipeline (rsrc:j3dcore.jar) to method sun.awt.AppContext.getAppContext()
WARNING: Please consider reporting this to the maintainers of javax.media.j3d.JoglPipeline
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO  [simulator] Simulator connected on TCP port 4560.
Init MAVLink
INFO  [commander] LED: open /dev/led0 failed (22)
``

Comment on lines +68 to +69
To use SITL simulation with jMAVSim you need to install the most recent version of Java (e.g. Java 15).
You can either download [Java 15 from Oracle](https://www.oracle.com/java/technologies/javase-downloads.html) or use the AdoptOpenJDK tap:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @hamishwillee says, whatever comes with Ubuntu 20.04 (which is what we're trying to support) should be fine.


```sh
brew tap AdoptOpenJDK/openjdk
brew install --cask adoptopenjdk14
brew install --cask adoptopenjdk15
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine.

@julianoes
Copy link
Contributor

@cdennison have you tried rebuilding it properly after doing rm -rf Tools/jMAVSim/out ?

@hamishwillee
Copy link
Collaborator

My take is that we don't change the docs because this should work for either Java and there is no point doing so unless we understand the cause of the actual problem. Any more debugging we might do @julianoes ?

@mrpollo
Copy link
Contributor

mrpollo commented Apr 7, 2021

fixed by #1095

@mrpollo mrpollo closed this Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants