Leaning Technologies

LT

Leaning Technologies

The home of Cheerp, CheerpJ, and CheerpX. Chat about virtual machines, compilers, and WebAssembly!

Join

CheerpJ missing functionality of original Jar file

I am trying to get my java swing projects in the browser, but the program is not working fully (it works as a JAR file just fine on Windows 11). It's a minesweeper clone I made that uses an array of JTextFields and uses repaint when updating colors, otherwise changing text to match an array that is the key when revealing a space. However, when using CheerpJ, it doesn't update a clicked tile space and sometimes just makes the game end (I have a checkWin() method). Additionally, a secondary game (there's a replay functionality) doesn't take. I downgraded the JAR file to run on Java1.8 (I'm using Eclipse IDE) and my program is less than 12 KB (it has 2 classes and one has 1110 lines with whitespace included)....

I'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/applets/RocketModeler/Rocket.html that they use cheerpj. I installed CheerpJ Applet Runner from the Chrome Webstore. When I download the ZIP https://www.grc.nasa.gov/www/k-12/airplane/javplts/rocket3/RocketModeler.zip, unzip it, and run a local webserver https://crates.io/crates/https for the unzipped directory, navigating there CheerpJ Applet Runner shows "runtime ready", then "loading", and then n...

Accessing Java class / object attributes in CheerpJ based PWA

I'm new to CheerpJ and I am working on creating a React Native module for ImageJ.js (CheerpJ translated version of Java based ImageJ aka ImJoy that runs in a progressive webapp (PWA)). I am running into an issue where attributes of Java objects on the JS side seem to have an integer after the attribute names (as shown in the image for this post). Upon further investigation I noticed a pattern where this integer seems to be the index of the attribute (eg. if a class 'Dog' has attributes 'height'...
No description

Int Conversion

There is a function in Java, that calls a native function with string argument, like setContentView("Hello World!"); and it works perfectly. Now repeat the same thing with integer: Java code: setContentView(2130903040); Native code:...
No description

State of the C++ modules support

When 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.jar example with no problems. However with my jar the process hangs at "Jar is loaded,main is starting" Is there anyway of logging where/why it gets stuck?...

Stretch to Fit Height Issue

Running a basic application in the example html provided on the CheerpJ website. My html code is effectively identical to the 'basic HTML example ' with the exception of using my own JAR files. Issue: I am attempting to fill the frame with cheerpjCreateDisplay(-1, -1, document.body). This results in the CheerpJ work area compressing into a single line at the top of the screen, it is treating -1 Height as, well, negative 1 instead of filling available area. -1 for Width works perfectly, no issue....

Problems with Cheerpj

Hello, I am trying to get my Java app running in CheerPJ - I was successful in creating a simple "Hello World" app with CheerPJ. However, my actual app (a jar file of about 4MB) doesn't work - it gets stuck at the "Graphics system is initializing" phase. I am looking for help (I am happy to share the actual .jar file if needed). Thank you Guido

Cache Results for Faster Startup?

Hello new user here. Performing initial research into potential commercial application usage. 1) Am I correct to assume that the Translation from Java to JScript is occurring on the Cheerpj server side when a webpage is loaded? 2) In a commercial environment in which a licensed local copy of CheerpJ is loaded, can the 'results' of the translation be cached, thereby serving up the JScript page much faster for subsequent users? Thank you, I am having a lot of fun and initial success so far!...

UnknownHostException happened when the Java application connect to server

UnknownHostException happened when the Java application connect to server. The host name is the same as I download the jar files, so the host should be resolvable.

HTTP 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 cannot run." when download jar files, the application cannot start. I can use the link to download the jar manually without problem....
Solution:
After I disabled compression in web server, the jar can be downloaded

Accesing the standard out and standard error stream from the Java process

How 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 would be a really cool feature :D

r[((0 + c) | 0)] is not a function when instantiating object

Hello, thank you all for developing CheerpJ, it is an impressive tool! I am playing around with trying to run hail, a scientific computing stack based on the JVM, in the browser using CheerpJ as I would love to eventually develop in-browser runnable documentation. I am able to load my JAR successfully, run some static methods on classes of mine and even instantiate some simple classes/case classes (this is a Scala project), but I'm running into the following error when trying to instantiate one of my core classes: ``` a.message: r[((0 + c) | 0)] is not a function a.stacktrace: "TypeError: r[((0 + c) | 0)] is not a function\n at Object.u4 [as a0] (https://cjrtnc.leaningtech.com/3.0rc2/cj3.js:1:10866)\n at PG (https://cjrtnc.leaningtech.com/3.0rc2/cj3.js:1:67131)\n at MessagePort.Uo (https://cjrtnc.leaningtech.com/3.0rc2/cj3.js:1:20680)"...

I'm always looking for the URL of the latest build of cj3loader.js by searching articles

I'm always looking for the URL of the latest build of cj3loader.js by searching articles, but is there a page somewhere that lists the latest builds?

Different behavior between extension and cj3loader

We have a java applet that runs perfectly when using the CheerpJ browser extension, but fails to fully load when using cj3loader script on the webpage. It gets to Initializing Graphics and then goes blank, never actually showing the applet. We originally had some JNI errors in the console but after we upgraded to https://cjrtnc.leaningtech.com/3_20231106_268/cj3loader.js (from the last help post) those errors disappeared. What is the difference between the extension and the loader and how can we get the full applet to run automatically?...

Can I try CheerpX?

I know it's not fully ready yet, but I think it's fine for my use cases in its current state

running java decompiler in browser, weird error

(copy-pasting from #cheerpj3 since i noticed this channel existed) i'm trying to run the procyon java decompiler inside cheerpj (3.0rc1), and i keep getting a JNI acquire failed, tid: 2 i searched the docs and i just have no idea what the error means repo of decompiler i'm trying to run: https://github.com/mstrobel/procyon...

Accessibility of Java applications

Hi team, I noticed that apps running on CheerpJ are not accessible to people with disabilities. This is unfortunate since UIs built with Swing offer decent support for accessibility out of the box. As an open-source contributor to the AccessKit project, I'd like to discuss with you a way to solve this issue, which would help Leaning Tech reach governments and big companies that have accessibility of their software as a hard requirement. I sent a message with more details to your main email addre...

jnlp launch verification fails with 64 bit swt libraries

The launch has below error. Java.lang.unsatisfiesLinkError: cannot load 64-bit SWT libraries on 32-bit JVM...