From 0d92b32162d97991553ac5bd6c513965bf8e203d Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Sat, 7 Dec 2019 17:01:33 +0100 Subject: [PATCH] add the compiler self to the library path --- src/de/inetsoftware/jwebassembly/JWebAssembly.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/de/inetsoftware/jwebassembly/JWebAssembly.java b/src/de/inetsoftware/jwebassembly/JWebAssembly.java index 370254b..a2bdede 100644 --- a/src/de/inetsoftware/jwebassembly/JWebAssembly.java +++ b/src/de/inetsoftware/jwebassembly/JWebAssembly.java @@ -24,6 +24,7 @@ import java.io.PrintWriter; import java.io.StringWriter; import java.net.MalformedURLException; import java.net.URL; +import java.security.ProtectionDomain; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -122,6 +123,10 @@ public class JWebAssembly { * Create a instance. */ public JWebAssembly() { + ProtectionDomain protectionDomain = getClass().getProtectionDomain(); + if( protectionDomain != null ) { + libraries.add( protectionDomain.getCodeSource().getLocation() ); // add the compiler self to the library path + } } /**