Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Andy725
    @andy98725
    it's based around a class, SerialArea extends java.awt.geom.Area implements Serializable
    it seems like the deserialization fails because CheerpJ misses the Path2D class, which the Area class uses
    in testing on my main project, including Path2D.Double somewhere seemed to solve the issue
    Wei Ouyang
    @oeway
    Hi team, not related to cheerpj, but for cheerpx: It seems the python3 demo is broken currently https://repl.leaningtech.com/python3.html
    It said Uncaught ReferenceError: cjThrowNPE is not defined
    Alessandro Pignotti
    @alexp-sssup
    @oeway That's the old demo page, which is not supported anymore. I'll remove it for good, use the new one instead https://repl.leaningtech.com/?python3
    Wei Ouyang
    @oeway
    Tried the new one already, thanks! This is awesome! Is there a dedicated gitter for cheerpx? I would like to know how cheerpx python works with numpy, scipy etc.
    Alessandro Pignotti
    @alexp-sssup
    @oeway There is no public support channel since CX is not released to the public for that use case yet. Contact us privately.
    Lorenzo
    @marsicplusplus

    @andy98725 we have found the cause of the bug in the deserialization. Are you able to continue working on your project while we look at this?

    Thanks for helping us finding this problem.

    Andy725
    @andy98725
    I am, with the workaround of including Path2D manually.
    Right now the game freezes on opening a PrintWriter to a file in a subdirectory of /files/ . I'm investigating and testing, but I'm not sure what causes it yet.
    If it's consistent, I'll set up a minimal use case to recreate it.
    Andy725
    @andy98725
    Can't seem to be able to recreate it outside of my project... Not sure what's causing it.
    Andy725
    @andy98725
    Interesting, changing the constructor from PrintWriter(String) to PrintWriter(File(String)) fixed it
    Here's what I'm getting now, though:
    The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
    Andy725
    @andy98725
    Up for testing at the same repo
    https://github.com/andy98725/Base-Wars-Test-Build
    Andy725
    @andy98725
    hmm... that error seems inconsistent, doesn't happen every time. Sometimes it just throws a
    javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file
        at javax.sound.sampled.AudioSystem.getAudioInputStream(Unknown Source)
    Also running into this now:
    Uncaught ReferenceError: _c4pbM_8nG1uocdGbrnTidabrEDjsqT$IJJc1Zg2eXkG0erK3o is not defined
        at _c4pbM_8nG1uocdGbrnTidabrYCjsGEbYYerKxp (rt.jar.sun.awt.image.js:318)
        at N4java3awt5image8LookupOp._h4p33awt5image8LookupOp6filterE3 (rt.jar.java.awt.image.js:222)
        at N4java3awt5image9RescaleOp._h4VZ3awt5image9Resem2YOp6filterE9 (rt.jar.java.awt.image.js:265)
        at N4java3awt5image9RescaleOp._h4VZ3awt5image9Resem2YOp6filterE8 (rt.jar.java.awt.image.js:265)
        at N6ingame7buttons4base15ButtonDisplay$2._c4_16ingame7buttons4base15Bf1a0Display$24makeE1 [as v16] (Base_Wars.jar.js:2386)
        at N6ingame7buttons4base15ButtonDisplay$2._c4_16ingame7buttons4base15Bf1a0Display$24makeE2 [as v11] (Base_Wars.jar.js:2386)
        at
    Lorenzo
    @marsicplusplus

    Hi @andy98725 ,

    the AudioContext message it's because on a webpage audio cannot be played if the source isn't actively in focus. That means that you will need to move the mouse over the applet to have the audio started.
    I'll take a look at your other errors during the day

    Lorenzo
    @marsicplusplus
    Hi @andy98725, could give me some instructions on how to replicate the audio exception?
    Example code there. Uses a custom audio class based around javax.sound.sampled.Clip
    Lorenzo
    @marsicplusplus
    @andy98725 I'm not able to replicate it with your example. The audio starts and plays correctly when the application is loaded (I'm trying with the 2.2 runtime)
    Andy725
    @andy98725
    I'll look into what's causing it in my local environment then.
    also, the RescaleOp error is more urgent to me at the moment, as that one is game-crashing.
    Lorenzo
    @marsicplusplus
    Hi @andy98725 , sorry for the delayed response.
    We are working in adding the missing function inside cheerpj, we will send you the link of an updated runtime as soon as possible
    Andy725
    @andy98725
    No problem! Thanks for the help :)
    Mark Jaroski
    @MarkJaroski
    do you think it's possible to compile and run an applet on a reverse proxy server
    ?
    Lorenzo
    @marsicplusplus
    Hi @MarkJaroski, it is possible, you just need to configure NGINX or whatever server you are using properly
    Lorenzo
    @marsicplusplus
    Hi @andy98725, sorry to keep you waiting!
    You can find the runtime that fixes the imagingLib exception (the second snippet you sent a couple of messages back) at https://cjrtnc.leaningtech.com/20210802/loader.js
    norzak
    @norzak
    CheerpJ has no WebGL support and very limited HTML5 Canvas support. Your DOM support is incomplete and unusable with no documentation, and has weird method name notations. It looks like your only aim is to run legacy Swing applications. Could you please clarify if this is the case? I am about to order a complete purge of our incomplete cheerpJ branch from our source control system.
    Carlo Piovesan
    @carlopi
    @norzak: CheerpJ can be used both to port existing, unmodified Java client applications will full runtime support (Swing, AWT), or to develop new HTML5 applications in Java (libraries in particular).
    There has been no requirement or requests so far to extend the features of CheerpJ that would allow the development of new visual applications, where the UI is also written in Java, hence the limited support to these. Should there be commercial interest in these features in the future, we would certainly be interested in working on them.
    norzak
    @norzak
    @carlopi Isnt CheerpJ a commercial product? From what I understand, you have in fact no interest in updating your DOM library. Anyways, thanks for the heads up.
    Alexander Salas Bastidas
    @ajsb85
    Hi, I want to build WebAssembly instead JS, are there special CLI commands?
    Lorenzo
    @marsicplusplus
    Dear @ajsb85
    CheerpJ uses WebAssembly internally for some components of the runtime. Java bytecode can only be compiled to JavaScript at this time since WebAssembly currently is not an efficient target for Java. CheerpJ will support WebAssembly output when the platform matures
    Wei Ouyang
    @oeway
    Hi, a quick question, is there a way to get the javascript or jython script engine work in cheerpj?
    Alessandro Pignotti
    @alexp-sssup
    @oeway Jython is currently not supported due to some subtle class init ordering issue. We have no experience with any JS engine
    Wei Ouyang
    @oeway
    Thanks for the quick answer @alexp-sssup I was hoping the Nashorn Javascript Engine which is part of Java SE 8 will work, but it doesn't.
    Is there any reason that it was excluded from the JRE?
    would be cool to have https://www.graalvm.org/ supported too, is there any chance that we compile a jar package and load it via cheepj and the script engine works?
    Wei Ouyang
    @oeway
    For example if we use cheerpj to compile graaljs-scriptengine.jar then add it as described here: https://www.graalvm.org/reference-manual/js/RunOnJDK/#scriptengine-jsr-223
    Alessandro Pignotti
    @alexp-sssup
    We have no experience with these specific VMs, if they use low level tricks with classloaders it's quite possible that they'll fall in unsupported territory
    Wei Ouyang
    @oeway
    ok, thanks for the clarification. I might give it a try.
    Is there a chance to expose the java context to native js and wrap it as a javascript engine?
    Would be the best solution if there is a way to do that
    Alessandro Pignotti
    @alexp-sssup
    There is some support for interoperability but doing such a low level integration would also be unsupported, in particular we cannot guarantee you that feature change won't break anything
    As usual, we are happy to prioritize and implement features if there is commercial demand/commitment
    Wei Ouyang
    @oeway
    Ok, got it, thanks! Will definitely consider that.
    AliCaliK1
    @AliCaliK1
    Is it possible send data to cheerpj's stdin?
    Alessandro Pignotti
    @alexp-sssup
    @AliCaliK1 stdin does not have a natural mapping to the Web platform, as such it is not supported.