--- a/interface/src/scilab/Makefile.am
+++ b/interface/src/scilab/Makefile.am
@@ -399,7 +399,7 @@
 .NOTPARALLEL: *
 
 all:
-	@SCILAB_EXE@ -nw -nb -f $(scilabbuilddir)/makefile_builder.sce
+	SCI_DISABLE_TK=1 SCI_JAVA_ENABLE_HEADLESS=1 @SCILAB_EXE@ -nw -nb -f $(scilabbuilddir)/makefile_builder.sce
 
 install:
 	$(mkinstalldirs) $(toolboxdir)/demos
@@ -470,4 +470,4 @@
 	@INSTALL@ -D -m 644 -t $(toolboxdir)/ $(scilabbasedir)
 
 clean:
-	@SCILAB_EXE@ -nw -nb -f $(scilabbuilddir)/makefile_cleaner.sce
+	SCI_DISABLE_TK=1 SCI_JAVA_ENABLE_HEADLESS=1 @SCILAB_EXE@ -nw -nb -f $(scilabbuilddir)/makefile_cleaner.sce
