Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Alessandro Pignotti
    @alexp-sssup
    can you verify from the network tab of the developers tools that your JAR is being correctly loaded?
    jonagh
    @jonagh
    My Jar was/is downloading fine. However I wasn't taking into account a dependency Jar. How do I make that work.. so I have MyClass.jar and MyDep.jar, currently I run cheerpjfy.py .\MyClass.jar, and I tried adding --deps=.\MyDep.jar? And in JS I'm doing: cheerpjRunJarWithClasspath('/app/mypath/MyClass.jar', '/app/mypath/MyDep.jar') - I've tried all this and although I see cheerpj doing a HEAD request on MyDep.jar I don't see it actually doing a GET on MyDep.jar. I think I'm confused. Also should I be cheerpjfy-ing MyDep.jar as well?
    Alessandro Pignotti
    @alexp-sssup
    cheerpjRunJarWithClassPath and cheerpjRunJar should be used only when the jar file has the correct manifest inside. They are equivalent to the native java command line jar -jar MyClass.jar. I suspect that in this case you should simply use the cheerpjRunMain API
    jonagh
    @jonagh
    Yup, that was it. Thanks.
    danormsby
    @danormsby
    Hi, I'm pretty sure I'm super close to getting my application working. Console shows three jars that are not part of my application.
    /toolbox.jar:1 Failed to load resource: the server responded with a status of 404 (Not Found)
    /bcmail-jdk14-138.jar:1 Failed to load resource: the server responded with a status of 404 (Not Found)
    /bcprov-jdk14-138.jar:1 Failed to load resource: the server responded with a status of 404 (Not Found)
    Are these provided on a URL by CheerpJ somewhere?
    Alessandro Pignotti
    @alexp-sssup
    @danormsby Most likely these JARs are declared as dependencies by the manifest of one of your JARs. CheerpJ does never add jars implicitly. It may also be that these 3 JARs are not needed to run the application. Have you tries to catch all exceptions in the main function?
    danormsby
    @danormsby
    Yes I did add the catch alls as suggested. Code never seemed to get to that. Had a dig in the manifests and I can't see the references. I'll dig some more.
    Thanks for the info and the quick response.
    Alessandro Pignotti
    @alexp-sssup
    @danormsby Ok, I suspect then that you don't even get to the main method, which usually means a dependency problem. You should make sure that the application can run in nativa Java with only the JARs you are using. For example cheerpjRunMain("Some.Class", "some.jar:other.jar", "arg1", "arg2") -> java -cp some.jar:other.jar Some.Class arg1 arg2 (on the command line, please be careful that the implicit jars are not somehow available to native java)
    @danormsby I can confirm 100% that these JARs you see do not come from CheerpJ in any way, they may also come from the manifest of inner JARs inside one of the JARs you are using. If the situation does not improve and you can create a publicly accessible minimal test case then we can also take a look
    danormsby
    @danormsby
    Thanks for the confirmation. I'll triple check everything here. Think it is all on the edge of working.
    danormsby
    @danormsby
    So my application works fine from the java -cp command line.
    I found the toolbox.jar reference in a compiled javascript.
    e=cheerpjInternString("You need the toolbox.jar with class com.lowagie.tools.Toolbox to use the iText Toolbox.");
    So that was inside iText-2.0.8.jar.js. I'll see if I can work out how to get it working.
    Thanks again for the tips.
    Or rather I can compile it but it throws an error.
    I set http://repo2.maven.org/maven2/org/slf4j/slf4j-api/1.7.29/slf4j-api-1.7.29.jar as a dependancy. Seems to fail the same way when I use the chrome applet compiling plugin.
    Command line compiler returns...
    compiling org/slf4j/impl/Log4jLoggerAdapter.class ...
    Failure compiling org/slf4j/impl/Log4jLoggerAdapter.class
    Alessandro Pignotti
    @alexp-sssup
    @danormsby I can only reproduce this failure message if I don't propertly specify the --deps option, so I think that there may be a mistake in the command line you are using
    If slf4j-log4j12-1.7.29.jar and slf4j-api-1.7.29.jar are in the same directory you should run the command cheerpjfy.py --deps slf4j-api-1.7.29.jar slf4j-log4j12-1.7.29.jar
    I can only see a failure message for org/apache/log4j/MDCFriend.class which may need another dependency. Keep in mind that AOT compile failure are not necessarily fatal, the class may be not used at runtime.
    Alessandro Pignotti
    @alexp-sssup
    I've tested with both CheerpJ 1.4 and CherepJ 2.0RC2
    danormsby
    @danormsby
    Thanks for testing. We use log4j quite a lot. I’m suspecting the compile fail. Bit inconvenient to refactor it all out but not impossible.
    Alessandro Pignotti
    @alexp-sssup
    I think I've not been clear. log4j should work, it's just a matter of correctly using the --deps options of cheerpjfy.py
    You mentioned iText, iText is part of our demos so I'm sure that it can work
    danormsby
    @danormsby
    Yes I did use the deps flag. Then rebuild the other jars I had with those as deps too. I think the iText message was a red herring.
    danormsby
    @danormsby
    I think the whole cheerpj project looks extremely interesting. I have a collection of prototypes working fine. We have a larger Java application with JavaFX and JNI components. I can imaging replacing those with straight HTML and WebAssembly.
    If I can get this app working I’ll get in touch about a commercial license.
    erfan
    @erfan-azhdari
    TextDemo.jar is not appearing correctly and no error reported image
    Alessandro Pignotti
    @alexp-sssup
    @erfan-azhdari Can you show us how CheerpJ is integrated in the page? Also make sure that the version of the compiler and of the runtime you are using are the same.
    erfan
    @erfan-azhdari

    <!DOCTYPE html>

    <html lang="en">
    <head>
    <meta charset="utf-8">
    <title>CheerpJ test</title>
    <script src="https://cjrtnc.leaningtech.com/latest/loader.js"></script>
    </head>
    <body>
    </body>
    <script>
    cheerpjInit();
    cheerpjCreateDisplay(800,600);
    cheerpjRunJar("/app/TextDemo.jar");
    </script>
    </html>

    and I've downloaded the compiler yesterday from your website
    Alessandro Pignotti
    @alexp-sssup
    @erfan-azhdari We don't recommend to use the latest endpoint, please make sure to use a versioned one
    erfan
    @erfan-azhdari
    which version
    ?
    Alessandro Pignotti
    @alexp-sssup
    Then the version you have is likely 1.4
    erfan
    @erfan-azhdari
    ok , I'll try
    Alessandro Pignotti
    @alexp-sssup
    You can verify this, if you open the TextDemo.jar.js file you will see the version of the compiler as a comment in the first line
    erfan
    @erfan-azhdari
    the version was 1.4 and it works after changing latest to 1.4
    Is there any way to use the applet runner offline?
    Alessandro Pignotti
    @alexp-sssup
    Fully offline no, our free users must use our cloud runtime
    erfan
    @erfan-azhdari
    how much does the paid version cost?
    Alessandro Pignotti
    @alexp-sssup
    We offer an option to self-host our runtime, but it is intended for private/company networks. There is not real "offline" option for consumers.
    Depending on your use case we might figure out something, please get in touch with sales@leaningtech.com
    erfan
    @erfan-azhdari
    ok thanks.