Leaning Technologies

LT

Leaning Technologies

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

Join
FF43nd1r4/24/2024

How to debug class loading

Hi, I'm dropping in here from github (https://github.com/leaningtech/cheerpj-meta/issues/195). I'm trying to run the kotlin compiler in a browser (https://github.com/F43nd1r/kotlin-compiler-cheerpj) - however this leads to "Bad class file cj3.js:1:420827" on the console with no further info. How can I debug here to see where the issue might be?
AAwesome4/12/2024

WASM-less compiling

Is there a way to compile Cheerp code into a single JS target without any extra WASM support when it's unnecessary? Currently, my understanding is that both cheerp and cheerp-wasm produce WASM output regardless of whether non-genericjs functions are called or not. Is that correct?
SSSadegh Soleimani4/7/2024

CheerPJ not showing anything

There is a class file in my code named AbstractPageBean which returns 404 when I run the page using cheerpj server side. 1- I am not sure if I implemented the server side correctly but in one of my applets, it says missing in myapplet$x.class, and in another says missing for AbstractPageBean 2- The code runs perfectly with CheerPJ extention 3- I use JSP and this is my code: ```...
AAwesome4/2/2024

Runtime class extending

How does a one extend existing JS class in Cheerp? JS example: ```js class ExtendedClass extends ExampleLibrary.BaseClass { /* ... */ }...
PPedro3/26/2024

Calling JS object member functions from Wasm

The pong tutorial (https://labs.leaningtech.com/cheerp/tutorials/pong) shows how to handle interactions between JS and Wasm using static functions and global instances. What is the recommended approach for accessing member functions of dynamically created JS objects from Wasm? Example code: ```cpp...
LLucas3/25/2024

How to start Cheeroj

I hadn't learned any java. How to use Cheerpj step by step?
EElias3/21/2024

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?...
EElizabeth3/19/2024

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)....
CCast3/13/2024

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...
DDarkForce83/12/2024

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
Крутой кАшАчОк3/3/2024

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
AAwesome2/25/2024

State of the C++ modules support

When the new C++ modules are expected to be supported?
Ddonquijote_sancho2/12/2024

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?...
TTangoLock2/6/2024

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....
GGuido2/6/2024

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
TTangoLock2/5/2024

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!...
Iitis2/5/2024

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.
Iitis2/5/2024

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
JJacobDK1232/1/2024

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?
Next