Java

Memory Optionen

  • -xms<size>: Initial and minimum Java heap size. For best performance, set -Xms to the same size as the maximum heap size.

  • -Xmx<size>: The maximum Java heap size.

  • -Xss<size>: Java thread stack size.

  • -XX:MaxMetaspaceSize=<size>: Java >= 8

  • -XX:MaxPermSize=<size>: Java < 8

  • -XX:MetaspaceSize=<size>: Metaspace Size, Java >= 8

  • -XX:PermSize=<size>: Java < 8

„Hello World“ direkt per Java ausführen

Eine einfache „Hello World“ Java-Applikation direkt per Java (ohne Applikationsserver) ausgeführt:

mkdir -p /tmp/HelloWorld/WEB-INF
/tmp/HelloWorld/index.jsp
<!doctype html>
<html>
<head>
<title>JSP Test</title>
<%!
String message = "Hello, World.";
%>
</head>
<body>
<h2><%= message%></h2>
<%= new java.util.Date() %>
</body>
</html>
/tmp/HelloWorld/WEB-INF/web.xml
<web-app>
<display-name>Hello World</display-name>
</web-app>
cd /tmp/HelloWorld
jar -cvf helloworld.war *.jsp WEB-INF

Built on 2022-06-03