JApplet NoClassDefFoundError

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 12:52:25

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.

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>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!