Skip to content

Commit

Permalink
AWS: Fix CLASSPATH to prevent NULL entry
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSerth authored and Dome-GER committed Oct 11, 2024
1 parent 105c8f2 commit f5e90f8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion deploy/aws/java11Exec/src/main/java/poseidon/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ public APIGatewayProxyResponseEvent handleRequest(final APIGatewayV2WebSocketEve
ProcessBuilder pb = new ProcessBuilder(cmd);
pb.directory(workingDirectory);
Map<String, String> env = pb.environment();
env.put("CLASSPATH", ".:/var/task/lib/org.hamcrest.hamcrest-3.0.jar:/var/task/lib/junit.junit-4.13.2.jar:" + env.get("CLASSPATH"));
if (env.containsKey("CLASSPATH")) {
env.put("CLASSPATH", ".:/var/task/lib/org.hamcrest.hamcrest-3.0.jar:/var/task/lib/junit.junit-4.13.2.jar:" + env.get("CLASSPATH"));
} else {
env.put("CLASSPATH", ".:/var/task/lib/org.hamcrest.hamcrest-3.0.jar:/var/task/lib/junit.junit-4.13.2.jar");
}
Process p = pb.start();
InputStream stdout = p.getInputStream(), stderr = p.getErrorStream();
this.forwardOutput(p, stdout, stderr);
Expand Down

0 comments on commit f5e90f8

Please sign in to comment.