Leaning Technologies

LT

Leaning Technologies

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

Join

Machine does not start completely: Unable to enter commands

Hello, I wanted to install cheerpx locally. I followed all the steps of the github but once deployed, the machine does not start. I have the interface but I can't enter commands. The "user@:~" never appears... I waited several hours but nothing happens. On the picture, it's already been running for 1 hour. How to do it? And forgive me for my English... I'm not an English speaker
No description

CheerpJ can't get my game onto a site

Hello, I tried to put my Java game (which is a jar file) into cheerpJ, and this is my code: ```<!doctype html> <html lang="en"> <head> <meta charset="utf-8" />...
No description

Experimenting with CheerpJ to revive Dusk GMUD game

Here's an opensource game server/client that I would love to see run in the browser again. I made a demo amount of game-play content but it's still not quite ready to be online. The Dusk application loaded and I tried to log in game but got this error. Error at keyPressed java.net.SocketException:Operation not permitted (Write failed) Here's the demo world server https://github.com/ZabinX/DuskRPG/tree/master/DuskFiles/Dusk47 start server like this java -cp . DuskServer Here's the DuskCheerpJ client experiment https://github.com/ZabinX/DuskRPG/tree/master/DuskFiles/Duskcheerpj...
No description

webvm local deployment issues

https://github.com/leaningtech/webvm When I follow the readme.md instructions I get a 403 on my nginx when I run sudo nginx -c $HOME/GITHUB/webvm/nginx.conf. What am I missing?...

Return std::string from cheerp::genericjs function

Got this working by peeking at the client::String definition, but would like to know if there is a cleaner alternative. Also, I don't quite get what is happening there. Is getLocal fully converted to JS? How is it able to manipulate a std::string? Thanks in advance :) ```cpp [[cheerp::genericjs]] std::string getLocal(const std::string& key) { std::string ret;...

hi there im interested in trying to somewhat integrate browsercraft to my website

im still quite new to to this can anyone help or tell me where to start
Solution:
@snakey man ok, you should be able to do
<iframe src="https://browsercraft.cheerpj.com/embed""></iframe>
<iframe src="https://browsercraft.cheerpj.com/embed""></iframe>
...

Sound format not supported?

I tried rerendering my sound to 16 bit with 44.1kHz sample rate but i still get this error and my whole program crashes (it works normaly outside of site):
java.lang.IllegalArgumentException: No line matching interface Clip supporting format PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, big-endian is supported.
java.lang.IllegalArgumentException: No line matching interface Clip supporting format PCM_SIGNED unknown sample rate, 16 bit, stereo, 4 bytes/frame, big-endian is supported.
Does anyone have any idea what could i do?...
Solution:
Sound in CheerpJ is completely unsupported right now, but we are working on this. Please provide a test case so that @Panini can consider it as part of this line of work.

Compatibility with the typeof, instanceof keywords

Is there any expected support for the mentioned keywords in the future? Currently it's not such a big deal when working with typeof as it can be easily polyfilled with inlining. While speaking of instanceof, I haven't seemed to find any intrinsics in the API (see below), which would allow me to pass the wanted types. I know it's not doable with just simple __asm__ as it's quite limited for this case
instanceof<client::Object>(object);
instanceof<client::Object>(object);
...

Need help with basic LWJGL 2.9.0 demo loading on CheerpJ

Hello, I am trying to get a very simple LWJGL 2.9.0 Demo working via CheerpJ, but am running into an error Error: window.lwjglCanvasElement is not set or is not a canvas. I've attached a picture of my project structure as well as the the error itself and some other relavent things. My desktop application is a NetBeans project using JDK 8. Here's the source code of the triangle that I found online: ```java package org.nemotech.opengl; import org.lwjgl.LWJGLException; import org.lwjgl.opengl.Display;...
Solution:
1. add this HTML to the start of the document body
<canvas id="lwjgl" width="800" height"600"></canvas>
<canvas id="lwjgl" width="800" height"600"></canvas>
2. to the script, add the following line before the cheerpjRunMain call:...
No description

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?

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?

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: ```...

Runtime class extending

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

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...

How to start Cheeroj

I hadn't learned any java. How to use Cheerpj step by step?

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

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
Next