문제

My question is pretty simple. Let's say that this is my entire codebase, and I cannot change it:

import java.awt.*;

public class Example1b extends java.applet.Applet
{
   public static void main(String [] args)
   {
      Frame f = new Frame("Example 1b");

      Example1b ex = new Example1b();

      f.add("Center", ex);

      f.pack();
      f.show();
   }
}

Is there any tricks I can do to make this run on a web server without display? I know that java.applet.Applet won't work in headless mode, so can I stub the awt classes, or do some other trickery?

도움이 되었습니까?

해결책

An Applet runs in the client's browser, applet viewer or IDE. Some alternatives to headless mode on the server are mentioned here, including JWS, VNC and Xvfb.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top