JApplet NoClassDefFoundError

前端 未结 2 1960
遇见更好的自我
遇见更好的自我 2021-01-26 09:28

I\'m writing an Japplet on Eclipse, and from a moment to another, it stopped to work on the html page.

Here are the errors:

  Exception in thread \"threa         


        
相关标签:
2条回答
  • 2021-01-26 09:51

    1st thing you did not add gson library in your classpath and second your request(GET /static/java/com/google/gson/Gson.class HTTP/1.1) is wrong.

    If you have gson jar under /static/java like MapGenerator.jar, you could make request for gson jar same as you did for MapGenerator.jar. But you can not make request to get class from that jar.

    0 讨论(0)
  • 2021-01-26 09:52

    Apparently nobody told me that I cannot insert a Jar inside another Jar, and hope that all works well.

    So I put my JAR libraries in the same folder of the applet, and I load the applet this way:

        <applet name="mapGenerator"
                id="mapGenerator"  
                code="main.MapGenerator.class"
                archive="{{STATIC_URL}}java/MapGenerator.jar, 
                                {{STATIC_URL}}java/gson-2.2.2.jar,
                                {{STATIC_URL}}java/plugin.jar"
                         >
                        <param name=id value="{{building.id}}">
                        <param name=piani value='{{floors}}'>  
                MAYSCRIPT
        </applet>
    
    0 讨论(0)
提交回复
热议问题