Bug 1460 : Cannot run program "java": error=2, No such file or directory on Mac OS X
Last modified: 2010-02-10 23:14




Status:
RESOLVED
Resolution:
INVALID -
Priority:
P2
Severity:
normal

 

Reporter:
KrisDS
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2010-02-10 22:21
I get a stack trace when clicking Run (on any program). Here are the
console details:

11/02/10 07:03:47 [0x0-0x104104].org.processing.app[2095] [JavaAppLauncher]
Requested [1.5*], launching in [1.6] instead.
11/02/10 07:04:14 [0x0-0x104104].org.processing.app[2095] Exception in
thread "Thread-4"
11/02/10 07:04:14 [0x0-0x104104].org.processing.app[2095] java.lang.Error:
Unable to launch target VM: java.io.IOException: Cannot run program "java":
error=2, No such file or directory
11/02/10 07:04:14 [0x0-0x104104].org.processing.app[2095] at
processing.app.debug.Runner.launchVirtualMachine(Runner.java:421)
11/02/10 07:04:14 [0x0-0x104104].org.processing.app[2095] at
processing.app.debug.Runner.launch(Runner.java:122)
11/02/10 07:04:14 [0x0-0x104104].org.processing.app[2095] at
processing.app.Editor$43.run(Editor.java:1652)
11/02/10 07:04:14 [0x0-0x104104].org.processing.app[2095] at
java.lang.Thread.run(Thread.java:637)

Processing 1.0.9.
Mac OS X Snow Leopard (10.6.2) on an intel MacBook Pro.

java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248-10M3025)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode)
Additional Comment #1 From KrisDS 2010-02-10 22:39
P.S. When running in Java 1.5 the error remains the same:

Exception in thread "Thread-4" java.lang.Error: Unable to launch target VM:
java.io.IOException: java: not found
at processing.app.debug.Runner.launchVirtualMachine(Runner.java:421)
at processing.app.debug.Runner.launch(Runner.java:122)
at processing.app.Editor$43.run(Editor.java:1652)
at java.lang.Thread.run(Thread.java:613)
Additional Comment #2 From fry 2010-02-10 22:42
You've installed Java 1.5 on a Snow Leopard machine?
Additional Comment #3 From KrisDS 2010-02-10 22:44
Yes, just to see if that might be a solution. It wasn't.
Additional Comment #4 From fry 2010-02-10 22:47
It sounds like you've done something to break your PATH environment
variable. Like you've set something strange in your environment file, an rc
file of some sort, or otherwise broken your machine setup so that OS X
can't find the path to /usr/bin/java. It's not a Processing bug.
Additional Comment #5 From KrisDS 2010-02-10 22:59
OSX finds it just fine when I try from the terminal:

$ ls /usr/bin/java
/usr/bin/java
$ echo $PATH
/sw/bin:/sw/sbin:/usr/local/bin:/opt/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Developer/Tools/Panda3D:/usr/texbin:/usr/local/bin:/Users/kdschutt/applications/lisp/cmucl-2007-10-x86-darwin/bin:/Users/kdschutt/applications/darcs/:/Users/kdschutt/work/3rd_party/btyacc/bin/:/Users/kdschutt/work/3rd_party/gdk-1.4.4/bin/:/usr/X11R6/bin
$ java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248-10M3025)
Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode)
$ which java
/usr/bin/java

The PATH variable is not broken; not from the terminal at least.
Additional Comment #6 From KrisDS 2010-02-10 23:14
Workaround for this invalid bug: grab Processing from svn, build it with
ant and then do:

ant run

Works just fine then.

I also tried the newly created Processing.app, but that shows the same
problem I reported earlier.