We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexDiscussionGeneral Discussion,  Status › [PATCH] Slow startup when using System VM on Linux
Page Index Toggle Pages: 1
[PATCH] Slow startup when using System VM on Linux (Read 658 times)
[PATCH] Slow startup when using System VM on Linux
Apr 13th, 2010, 2:23am
 
I am posting this here because I cannot login to the bug tracker.

In my Gentoo Linux machine, processing starts extremely slowly (>60 second) when using System JDK. The culprit is this line:
Code:
JDKDIR=`which java` && ... omitted for clarity ...  



In my machine, `which java` returns "/usr/bin/java" and some magic in make_jdkcp() causes the script to search for my entire /usr/ for the real JDK directory.

The fix:
Code:

Index: processing
===================================================================
--- processing  (revision 6618)
+++ processing  (working copy)
@@ -78,7 +78,7 @@
# Local JDK found?
if [ $SUCCESS -ne 1 ]; then
  # No, try using the preferred system JRE/JDK (if any)
-  JDKDIR=`which java` && JDKDIR=`readlink -e "$JDKDIR"` && JDKDIR=`dirname "$JDKDIR"`/..
+  JDKDIR="$JDK_HOME/"
  make_jdkcp "$JDKDIR"
  log SUCCESS
fi


The patch uses $JDK_HOME environment variable to find the direcotry to the JDK. This environment variable should be set to wherever the System JDK is. It might break if the system doesn't properly set their $JDK_HOME, do you think it should try to fallback to the old method if this variable isn't set?
Page Index Toggle Pages: 1