<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Christian,</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
As I explained in my first email, I did run the native agent first and created the configuration files that I'm using in the native-image command line.</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best regards, Eric. </div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>De :</b> Christian Wimmer <christian.wimmer@oracle.com><br>
<b>Envoyé :</b> lundi 16 octobre 2023 20:45<br>
<b>À :</b> Eric Samson <erix.samson@gmail.com>; Gilles DUBOSCQ <gilles.m.duboscq@oracle.com><br>
<b>Cc :</b> graalvm-users@oss.oracle.com <graalvm-users@oss.oracle.com><br>
<b>Objet :</b> Re: [graalvm-users] [External] : java.lang.Thread.sleep() supported in GraalVM?</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
AWT in general works on Windows and Linux (we are still working on Darwin support).</div>
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
You are responsible though for reflection, JNI, and resource registrations that AWT requires. It is a good idea to run the application first on HotSpot with the tracing agent to get an overview of which registrations are necessary at image build time.</div>
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
-Christian<br>
</div>
<div id="x_appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Eric Samson <erix.samson@gmail.com><br>
<b>Sent:</b> Monday, October 16, 2023 11:35<br>
<b>To:</b> Christian Wimmer <christian.wimmer@oracle.com>; Gilles DUBOSCQ <gilles.m.duboscq@oracle.com><br>
<b>Cc:</b> graalvm-users@oss.oracle.com <graalvm-users@oss.oracle.com><br>
<b>Subject:</b> Re: [graalvm-users] [External] : java.lang.Thread.sleep() supported in GraalVM?</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div class="x_x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hi Christian,</div>
<div class="x_x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I have removed the --initialize-at-build-time option, and it's not better.</div>
<div class="x_x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Does it mean that Swing is not compatible with GraalVM? </div>
<div class="x_x_elementToProof">
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div id="x_x_Signature">
<div><span style="font-size:12pt; color:rgb(210,71,38)"><b>::</b></span><span style="font-size:12pt; background-color:rgb(255,255,255)"> </span><span style="font-size:13px">Cordialement, Eric Samson</span><br>
<span style="font-size:13px">+33 6 6440 4837</span></div>
</div>
</div>
<div id="x_x_appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>De :</b> Christian Wimmer <christian.wimmer@oracle.com><br>
<b>Envoyé :</b> lundi 16 octobre 2023 20:16<br>
<b>À :</b> Eric Samson <erix.samson@gmail.com>; Gilles DUBOSCQ <gilles.m.duboscq@oracle.com><br>
<b>Cc :</b> graalvm-users@oss.oracle.com <graalvm-users@oss.oracle.com><br>
<b>Objet :</b> Re: [graalvm-users] [External] : java.lang.Thread.sleep() supported in GraalVM?</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div class="x_x_x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hi Eric,</div>
<div class="x_x_x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_x_x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
As Gilles already said, initializing all classes at build time is something that cannot work for your use case. For AWT, a lot of class initializer call into native code to initialize OS state, and that state cannot be transferred from image build time to image
run time.</div>
<div class="x_x_x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_x_x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
-Christian<br>
</div>
<div id="x_x_x_appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_x_x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Gilles DUBOSCQ via GraalVM-Users <graalvm-users@oss.oracle.com><br>
<b>Sent:</b> Monday, October 16, 2023 11:10<br>
<b>To:</b> Eric Samson <erix.samson@gmail.com><br>
<b>Cc:</b> graalvm-users@oss.oracle.com <graalvm-users@oss.oracle.com><br>
<b>Subject:</b> Re: [graalvm-users] [External] : java.lang.Thread.sleep() supported in GraalVM?</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div class="x_x_x_x_elementToProof x_x_x_x_ContentPasted0" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
It looks like the issue is not with Thread.sleep but Swing/AWT on Windows (specifically sun.awt.shell.Win32ShellFolderManager2$ComInvoker).</div>
<div class="x_x_x_x_elementToProof x_x_x_x_ContentPasted0" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_x_x_x_elementToProof x_x_x_x_ContentPasted0 x_x_x_x_ContentPasted1 x_x_x_x_ContentPasted2 x_x_x_x_ContentPasted3 x_x_x_x_ContentPasted4 x_x_x_x_ContentPasted5 x_x_x_x_ContentPasted7" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I think it's not a good idea to use --initialize-at-build-time, you're likely to get into a lot of such corner cases. In general only code that has been designed for it or has explicit support in native-image works well under --initialize-at-build-time. I would
recommend to use --initialize-at-build-time only on specific packages or type for which you know there is a real benefit.<br>
</div>
<div class="x_x_x_x_elementToProof x_x_x_x_ContentPasted0 x_x_x_x_ContentPasted1 x_x_x_x_ContentPasted2 x_x_x_x_ContentPasted3 x_x_x_x_ContentPasted4 x_x_x_x_ContentPasted6" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
If you really want to initialize everything at build time, maybe you can try to use --initialize-at-run-time=sun.awt.shell.Win32ShellFolder2</div>
<div class="x_x_x_x_elementToProof x_x_x_x_ContentPasted0 x_x_x_x_ContentPasted1 x_x_x_x_ContentPasted2 x_x_x_x_ContentPasted3 x_x_x_x_ContentPasted4 x_x_x_x_ContentPasted6" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_x_x_x_elementToProof x_x_x_x_ContentPasted0 x_x_x_x_ContentPasted1 x_x_x_x_ContentPasted2 x_x_x_x_ContentPasted3 x_x_x_x_ContentPasted4 x_x_x_x_ContentPasted6" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Gilles<br>
</div>
<div id="x_x_x_x_appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_x_x_x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Eric Samson <erix.samson@gmail.com><br>
<b>Sent:</b> Monday, 16 October 2023 19:10<br>
<b>To:</b> Gilles DUBOSCQ <gilles.m.duboscq@oracle.com><br>
<b>Cc:</b> graalvm-users@oss.oracle.com <graalvm-users@oss.oracle.com><br>
<b>Subject:</b> Re: [External] : [graalvm-users] java.lang.Thread.sleep() supported in GraalVM?</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
Hi Gilles,</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
<br>
</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
Thanks for the quick reply.</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
Here is the error message:</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
<br>
</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
<b>Error</b>: Detected a started Thread in the image heap. Threads running in the image generator are no longer running at image runtime. To see how this object got instantiated use --trace-object-instantiation=java.lang.Thread. The object was probably created
by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your
main entry point.<br>
</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
<br>
</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
I've tried the option --initialize-at-runtime=java.lang.Thread, without success.</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
<br>
</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
<b>StackTrace:</b></div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
Trace: Object was reached by<br>
reading field java.util.concurrent.ThreadPoolExecutor$Worker.thread of constant<br>
java.util.concurrent.ThreadPoolExecutor$Worker@63a4cfd: java.util.concurrent.ThreadPoolExecutor$Worker@63a4cfd[State = 1, empty queue]<br>
reading field java.util.HashMap$Node.key of constant<br>
java.util.HashMap$Node@53798803: java.util.concurrent.ThreadPoolExecutor$Worker@63a4cfd[State = 1, empty queue]=j...<br>
indexing into array java.util.HashMap$Node[]@2f2400d: [Ljava.util.HashMap$Node;@2f2400d<br>
reading field java.util.HashMap.table of constant<br>
java.util.HashMap@1ac46e3c: {java.util.concurrent.ThreadPoolExecutor$Worker@63a4cfd[State = 1, empty queue]=...<br>
reading field java.util.HashSet.map of constant<br>
java.util.HashSet@74b3b357: [java.util.concurrent.ThreadPoolExecutor$Worker@63a4cfd[State = 1, empty queue]]<br>
reading field java.util.concurrent.ThreadPoolExecutor.workers of constant<br>
sun.awt.shell.Win32ShellFolderManager2$ComInvoker@7f227548: sun.awt.shell.Win32ShellFolderManager2$ComInvoker@7f227548[Running, pool size = ...<br>
scanning root sun.awt.shell.Win32ShellFolderManager2$ComInvoker@7f227548: sun.awt.shell.Win32ShellFolderManager2$ComInvoker@7f227548[Running, pool size = ... embedded in<br>
sun.awt.shell.ShellFolder.invoke(ShellFolder.java:537)<br>
parsing method sun.awt.shell.ShellFolder.invoke(ShellFolder.java:537) reachable via the parsing context<br>
at sun.awt.shell.Win32ShellFolder2.<init>(Win32ShellFolder2.java:292)<br>
at com.oracle.svm.core.code.FactoryMethodHolder.Win32ShellFolder2_constructor_79b7324abf2daa84de416777f746e499d5310ac3(generated:0)<br>
at sun.awt.shell.Win32ShellFolderManager2.getDesktop(Win32ShellFolderManager2.java:171)<br>
at sun.awt.shell.Win32ShellFolderManager2.isFileSystemRoot(Win32ShellFolderManager2.java:504)<br>
at javax.swing.filechooser.FileSystemView.isFileSystemRoot(FileSystemView.java:423)<br>
at javax.swing.filechooser.FileSystemView.getFiles(FileSystemView.java:581)<br>
at javax.swing.filechooser.FileSystemView.isParent(FileSystemView.java:338)<br>
at javax.swing.JFileChooser.setSelectedFile(JFileChooser.java:513)<br>
at javax.swing.JFileChooser.setFileFilter(JFileChooser.java:1472)<br>
at javax.swing.JFileChooser.setup(JFileChooser.java:398)<br>
at javax.swing.JFileChooser.<init>(JFileChooser.java:362)<br>
at com.oracle.svm.core.code.FactoryMethodHolder.JFileChooser_constructor_0980039f483e9a48b2389d8a4a1a9cd473a16dbd(generated:0)<br>
at javax.swing.text.html.FormView$BrowseFileAction.actionPerformed(FormView.java:968)<br>
at java.awt.MenuItem.processActionEvent(MenuItem.java:692)<br>
at java.awt.MenuItem.processEvent(MenuItem.java:651)<br>
at java.awt.MenuComponent.dispatchEventImpl(MenuComponent.java:379)<br>
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)<br>
at java.awt.EventQueue$4.run(EventQueue.java:722)<br>
at java.awt.EventQueue$4.run(EventQueue.java:716)<br>
at com.oracle.svm.core.jdk.Target_java_security_AccessController.executePrivileged(SecuritySubstitutions.java:171)<br>
at sun.font.SunFontManager.<init>(SunFontManager.java:457)<br>
at sun.awt.Win32FontManager.<init>(Win32FontManager.java:88)<br>
at com.oracle.svm.core.code.FactoryMethodHolder.Win32FontManager_constructor_002b6104bcda27602265e5cec50c16a5ebc813af(generated:0)<br>
at static root method.(Unknown Source)<br>
</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
<br>
</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
<b>My Groovy code snippet:</b></div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
<br>
</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
@groovy.transform.CompileStatic<br>
class App { <br>
static void main(String[] args) {<br>
// some very simple Swing UI init here</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
while (true) {<br>
time = LocalTime.now()<br>
label.text = " " + time.format("HH:mm:ss")<br>
Thread.sleep(1000)<br>
}<br>
</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
}</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
<br>
</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
<b>My native-compile command line:</b></div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
native-image --report-unsupported-elements-at-runtime --initialize-at-build-time --trace-class-initialization=java.lang.Thread --no-fallback -H:ConfigurationFileDirectories=conf/ -cp ".;%GROOVY_HOME%lib\groovy-4.0.9.jar;%GROOVY_HOME%lib\groovy-datetime-4.0.9.jar"
displaytime.App<br>
</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
<br>
</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
<b>My native-agent command line (works well):</b></div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
java -agentlib:native-image-agent=config-output-dir=conf/ displaytime.App<br>
</div>
<div class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:#3333ff">
<br>
</div>
<div>
<div dir="ltr" class="x_x_x_x_x_gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr"><font size="2"><font color="#ff6600" face="tahoma, sans-serif"><b>::</b></font><font color="#3333ff" face="tahoma, sans-serif"> Cordialement<span class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:rgb(51,51,255)">/Best
regards</span>, Eri<span class="x_x_x_x_x_gmail_default" style="font-family:tahoma,sans-serif; font-size:small; color:rgb(51,51,255)">x</span></font></font>
<div><br>
</div>
</div>
</div>
</div>
</div>
<br>
<div class="x_x_x_x_x_gmail_quote">
<div dir="ltr" class="x_x_x_x_x_gmail_attr">Le lun. 16 oct. 2023 à 18:48, Gilles DUBOSCQ <<a href="mailto:gilles.m.duboscq@oracle.com">gilles.m.duboscq@oracle.com</a>> a écrit :<br>
</div>
<blockquote class="x_x_x_x_x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div class="x_x_x_x_x_msg-9024239459165651314">
<div dir="ltr">
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hi Eric,</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Yes Thread.sleep() should work in GraalVM native-image.<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
It would help to know what kind of error you're seeing exactly.</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Gilles<br>
</div>
<div id="x_x_x_x_x_m_-9024239459165651314appendonsend"></div>
<hr style="display:inline-block; width:98%">
<div id="x_x_x_x_x_m_-9024239459165651314divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Eric Samson via GraalVM-Users <<a href="mailto:graalvm-users@oss.oracle.com" target="_blank">graalvm-users@oss.oracle.com</a>><br>
<b>Sent:</b> Monday, 16 October 2023 18:38<br>
<b>To:</b> <a href="mailto:graalvm-users@oss.oracle.com" target="_blank">graalvm-users@oss.oracle.com</a> <<a href="mailto:graalvm-users@oss.oracle.com" target="_blank">graalvm-users@oss.oracle.com</a>><br>
<b>Subject:</b> [External] : [graalvm-users] java.lang.Thread.sleep() supported in GraalVM?</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div style="font-family:tahoma,sans-serif; font-size:small; color:rgb(51,51,255)">
<div style="border:0px; font-variant-numeric:inherit; font-variant-east-asian:inherit; font-variant-alternates:inherit; font-stretch:inherit; font-size:12pt; line-height:inherit; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-kerning:inherit; font-feature-settings:inherit; margin:0px; padding:0px; vertical-align:baseline; color:rgb(0,0,0)">
Hi everyone,</div>
<div style="border:0px; font-variant-numeric:inherit; font-variant-east-asian:inherit; font-variant-alternates:inherit; font-stretch:inherit; font-size:12pt; line-height:inherit; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-kerning:inherit; font-feature-settings:inherit; margin:0px; padding:0px; vertical-align:baseline; color:rgb(0,0,0)">
<br>
</div>
<div style="border:0px; font-variant-numeric:inherit; font-variant-east-asian:inherit; font-variant-alternates:inherit; font-stretch:inherit; font-size:12pt; line-height:inherit; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-kerning:inherit; font-feature-settings:inherit; margin:0px; padding:0px; vertical-align:baseline; color:rgb(0,0,0)">
I'm totally new to GraalVM.</div>
<div style="border:0px; font-variant-numeric:inherit; font-variant-east-asian:inherit; font-variant-alternates:inherit; font-stretch:inherit; font-size:12pt; line-height:inherit; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-kerning:inherit; font-feature-settings:inherit; margin:0px; padding:0px; vertical-align:baseline; color:rgb(0,0,0)">
I've set up the whole environment for Windows this morning. </div>
<div style="border:0px; font-variant-numeric:inherit; font-variant-east-asian:inherit; font-variant-alternates:inherit; font-stretch:inherit; font-size:12pt; line-height:inherit; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-kerning:inherit; font-feature-settings:inherit; margin:0px; padding:0px; vertical-align:baseline; color:rgb(0,0,0)">
<br>
</div>
<div style="border:0px; font-variant-numeric:inherit; font-variant-east-asian:inherit; font-variant-alternates:inherit; font-stretch:inherit; font-size:12pt; line-height:inherit; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-kerning:inherit; font-feature-settings:inherit; margin:0px; padding:0px; vertical-align:baseline; color:rgb(0,0,0)">
I'm now trying to natively compile a Groovy app (with neither dynamic nor meta programming).</div>
<div style="border:0px; font-variant-numeric:inherit; font-variant-east-asian:inherit; font-variant-alternates:inherit; font-stretch:inherit; font-size:12pt; line-height:inherit; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-kerning:inherit; font-feature-settings:inherit; margin:0px; padding:0px; vertical-align:baseline; color:rgb(0,0,0)">
I've been able to compile it and use the native-image-agent to generate the /conf files.</div>
<div style="border:0px; font-variant-numeric:inherit; font-variant-east-asian:inherit; font-variant-alternates:inherit; font-stretch:inherit; font-size:12pt; line-height:inherit; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-kerning:inherit; font-feature-settings:inherit; margin:0px; padding:0px; vertical-align:baseline; color:rgb(0,0,0)">
<br>
</div>
<div style="border:0px; font-variant-numeric:inherit; font-variant-east-asian:inherit; font-variant-alternates:inherit; font-stretch:inherit; font-size:12pt; line-height:inherit; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-kerning:inherit; font-feature-settings:inherit; margin:0px; padding:0px; vertical-align:baseline; color:rgb(0,0,0)">
Now I'm trying to generate the executable and I get an error message due to the fact I'm using Thread.sleep(x) in my main loop.</div>
<div style="border:0px; font-variant-numeric:inherit; font-variant-east-asian:inherit; font-variant-alternates:inherit; font-stretch:inherit; font-size:12pt; line-height:inherit; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-kerning:inherit; font-feature-settings:inherit; margin:0px; padding:0px; vertical-align:baseline; color:rgb(0,0,0)">
<br>
</div>
<div style="border:0px; font-variant-numeric:inherit; font-variant-east-asian:inherit; font-variant-alternates:inherit; font-stretch:inherit; font-size:12pt; line-height:inherit; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-kerning:inherit; font-feature-settings:inherit; margin:0px; padding:0px; vertical-align:baseline; color:rgb(0,0,0)">
Sleep is a static method of the Thread class. I understand there must be some kind of conflicts between the class being initialized at build-time or runtime. But I'm not sure how to fix it. I've spent a lot of time in the GraalVM documentation and several Web
sites (stackOverflow, etc.) but could not find a good example of how to use Thread.sleep in GraalVM.</div>
<div style="border:0px; font-variant-numeric:inherit; font-variant-east-asian:inherit; font-variant-alternates:inherit; font-stretch:inherit; font-size:12pt; line-height:inherit; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-kerning:inherit; font-feature-settings:inherit; margin:0px; padding:0px; vertical-align:baseline; color:rgb(0,0,0)">
<br>
</div>
<div style="border:0px; font-variant-numeric:inherit; font-variant-east-asian:inherit; font-variant-alternates:inherit; font-stretch:inherit; font-size:12pt; line-height:inherit; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-kerning:inherit; font-feature-settings:inherit; margin:0px; padding:0px; vertical-align:baseline; color:rgb(0,0,0)">
Sorry for the noob question. Any hint would be greatly appreciated. Thanks in advance.</div>
<div style="border:0px; font-variant-numeric:inherit; font-variant-east-asian:inherit; font-variant-alternates:inherit; font-stretch:inherit; font-size:12pt; line-height:inherit; font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-kerning:inherit; font-feature-settings:inherit; margin:0px; padding:0px; vertical-align:baseline; color:rgb(0,0,0)">
Best regards, Erix.</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>