Java Applet: Increase stack size

大憨熊 提交于 2019-12-24 07:06:03

问题


I was writing a small Java Applet in Eclipse to test a recursive algorithm. Since there are quite a lot recursive calls I needed to increase the stack size: -Xss10m This worked.

Then I wanted to test the applet outside of Eclipse with appletviewer. So I wrote the needed html-file MyStuff.html:

<html> 
    <applet code="MyStuff.class" ARCHIVE=myjar.jar height=512 width=512>
        <PARAM name="java_arguments" value="-Xss10m">
    </applet>
</html>

In order to start the applet I compile MyStuff.java: javac -cp ./myjar.jar:./ MyStuff.java and then call the appletviewer: appletviewer MyStuff.html

But it seems that the stack size isn't adjusted because I get an StackoverflowException. Even if I increase the stack to an even bigger size it isn't working. When asking google I only found questions about changing the heap size for applets but I couldn't find someting for the stack size. So is it not possible? - But using Eclipse works fine... Or what am I doing wrong?

EDIT: I found this answer (heap instead of stack): Java Heap Space: Applets But a comment implies that this won't work for appletviewer

来源:https://stackoverflow.com/questions/23044602/java-applet-increase-stack-size

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