btrace icon indicating copy to clipboard operation
btrace copied to clipboard

Unsupported class file major version 29281

Open joachimhs opened this issue 2 years ago • 4 comments

Hello,

I am getting the following when I am trying to start my Java Application via the command line. I have built the app on JDK 16, and I am starting it on JDK 16. Using the Brace 2.2.2 download from GitHub. I am running this in an Apple Silicon Mac.

What version of Java do I need to use?

joachimhs avatar Sep 09 '22 15:09 joachimhs

Hm. It seems that when I run BTrace with -javaagent, and use the scriptdir command, it picks up any file in that directory. Not only .class files. So the file .DS_Store (that gets automatically generated on Macs for each folder), is picked up and attempted to load into the Java application.

joachimhs avatar Sep 09 '22 19:09 joachimhs

This is very strange - there is definitely no version 29281 of the java class format.

Can you provide the exact steps to reproduce, please?

jbachorik avatar Sep 09 '22 21:09 jbachorik

Hello,

Looking at this, it seems that BTrace attempts to pick up any file in the scriptdir directory, so when it tries to pick up this ".DS_Store" file, it throws that exception.

Skjermbilde 2022-09-10 kl  07 57 56

I think there ought to be a filter that filters out anything not ending with .class when loading script files from a directory.

joachimhs avatar Sep 10 '22 05:09 joachimhs

Created PR: https://github.com/btraceio/btrace/pull/580

joachimhs avatar Sep 10 '22 09:09 joachimhs

Stale issue message

github-actions[bot] avatar Nov 10 '22 00:11 github-actions[bot]