Keep in mind that a script running in cron does not have the same environment as a script running in shell.
The cron daemon starts a subshell from your HOME directory.
The cron daemon supplies a default environment for every shell, defining HOME, LOGNAME, SHELL (=/usr/bin/sh), and PATH (=/usr/bin).
Do not depend on environment variables. This includes path setting, x11 settings, or anything else.
Use full path, for example:
instead of symply calling java or python you have to use /usr/bin/java or /usr/bin/python.