Options for running Java versions more recent than Java 8

I'm a doctoral researcher, and part of my tasks is providing technical support for grading student projects for a Java course. I won't get into the details, and instead just state my goal: I would like students and teaching assistants to be able to run student projects in the browser. The issue I am running into is that we target source level 21, so CheerpJ rejects the JAR outright. For educational reasons we don't want to lower this to 8, even though 99% of code should be compatible with 8. So, my question: what are my options here? Are there experimental builds supporting Java 21 (or 17)? Is there a way to compile newer bytecode to an older version? Thanks in advance!
apignotti
apignotti58d ago
Currently CheerpJ only supports Java 8, but the architecture is designed to support more modern versions of Java as well Support for Java 11 is coming later in the year, after the summer most likely Depending on the complexity of Java 11 support we might managed to support Java 17 in the same release, but that is a stretch goal. We do not have experimental builds to share at this time What you want to achieve is 100% possible, but it will need a few more months The timeline might be accelerated if a commercial user decides to sponsor the effort to support modern Java. In that case we will be able to dedicate more resources to the project.
kloppi
kloppi54d ago
I'm trying to instead compile my code to Java 8 with javac -source 1.8 -target 1.8. The code compiles fine, but when trying to run it with CheerpJ, it still says "Uncaught (in promise) CheerpJ only supports Java 8 at this time."
apignotti
apignotti54d ago
We recommend compiling with javac from JDK8 I am unsure about what is the precise semantics of -target 1.8, it's likely that is not the same CheerpJ is internally checking the actual version of the .class file Also, keep in mind that you need to compile all classes for Java 8, you might have dependencies which are not compiled with the correct command line In any case, using JDK8 is the safest option
Want results from more Discord servers?
Add your server
More Posts
CheerpJ missing functionality of original Jar fileI am trying to get my java swing projects in the browser, but the program is not working fully (it wI'd like to run NASA's Rocket Modeler on my laptop.I see from the NASA webpage https://www1.grc.nasa.gov/wp-content/plugins/cheerpj-integration/lib/appAccessing Java class / object attributes in CheerpJ based PWAI'm new to CheerpJ and I am working on creating a React Native module for ImageJ.js (CheerpJ translaInt ConversionThere is a function in Java, that calls a native function with string argument, like `setContentViewState of the C++ modules supportWhen the new C++ modules are expected to be supported?Cheerpj hangs after "Jar is loaded,main is starting"I am trying to use cheerpj to run my Java Swing app in a browser. I can run the example SwingSet3.jaStretch to Fit Height IssueRunning a basic application in the example html provided on the CheerpJ website. My html code is efProblems with CheerpjHello, I am trying to get my Java app running in CheerPJ - I was successful in creating a simple "HeCache Results for Faster Startup?Hello new user here. Performing initial research into potential commercial application usage. 1) AmUnknownHostException happened when the Java application connect to serverUnknownHostException happened when the Java application connect to server. The host name is the sameHTTP server returned compressed partial data. That should not happen. CheerpJ cannot run.Browser shows error "HTTP server returned compressed partial data. That should not happen. CheerpJ cAccesing the standard out and standard error stream from the Java processHow do I from javascript access the output streams from the started Java process?Any plan on adding internet access without Tailscale?Hi there ! Do you plan on adding internet access without the need to install Tailscale etc, that wour[((0 + c) | 0)] is not a function when instantiating objectHello, thank you all for developing CheerpJ, it is an impressive tool! I am playing around with tryiI'm always looking for the URL of the latest build of cj3loader.js by searching articlesI'm always looking for the URL of the latest build of cj3loader.js by searching articles, but is theDifferent behavior between extension and cj3loaderWe have a java applet that runs perfectly when using the CheerpJ browser extension, but fails to fulCan I try CheerpX?I know it's not fully ready yet, but I think it's fine for my use cases in its current staterunning java decompiler in browser, weird error(copy-pasting from #cheerpj3 since i noticed this channel existed) i'm trying to run the procyon javAccessibility of Java applicationsHi team, I noticed that apps running on CheerpJ are not accessible to people with disabilities. Thisjnlp launch verification fails with 64 bit swt librariesThe launch has below error. Java.lang.unsatisfiesLinkError: cannot load 64-bit SWT libraries on 32-b