leaningtech / cheerpj-meta

Run Java 8 applications, libraries, applets, Java Web Start, and Oracle Forms on the web without legacy plugins.
https://labs.leaningtech.com/cheerpj
459 stars 21 forks source link

Class compiled with Java 8 not runnable #191

Closed dsyer closed 7 months ago

dsyer commented 7 months ago

There seems to be something missing here (maybe Java 8 is not enough on its own?). At runtime:

java.lang.UnsupportedClassVersionError: CheerpJ only supports Java 8 at this time. Unsupported class com/example/commandlinerunner/CommandlinerunnerApplication

Check that the class file is valid:

$ javap -verbose  -cp target/classes com.example.commandlinerunner.CommandlinerunnerApplication | grep version
  minor version: 0
  major version: 52
alexp-sssup commented 7 months ago

The check is exactly over the major and minor eversion, so there must be a mismatch between the class provided to CheerpJ and the one you are testing with javap. Please double check that. In particular, be mindful of browser caching.

Otherwise publish a fully contained test case on a public website for us to reproduce.

dsyer commented 7 months ago

Any tips for clearing browser caches? I can't see anything in the dev console in Chrome.

UPDATE: found it (checkbox in "Network" tab). But F5 and CTRL-F% should work right (and they didn't)?

bates64 commented 7 months ago

Reloading the page (e.g. by pressing F5) doesn't clear your cache. On Chromium and derivatives, when you have the developer tools open, you can right-click the reload button to access 'Hard Reload' and 'Empy cache and hard reload' options.