javaeclipsejavaw

Cannot find javaw on eclipse to run hello world


This is some strange and annoying issue i am facing . I was just going through some issue and decided to write simple program to solve it. It seems that eclipse cannot execute "hello world" and this is the error message I get

Exception occurred executing command line. Cannot run program ""\"C:\Program
Files\Java\jre6\bin\javaw.exe\""" (in directory "D:\Vishal_j2E\HelloWorld")
CreateProcess error=3, The system cannot find the path specified

Notice the javaw.exe path.

Then I copied the Java folder to D: (may be something to do with space between program file) and in eclipse

 Windows>Preference>Java>Installed Jres

added the D: path to it. Still I have the same issue except for the path has changed from C: to D:

 Exception occurred executing command line.
Cannot run program ""\"D:\Java\jre6\bin\javaw.exe\""" 
(in directory "D:\Vishal_j2E\HelloWorld"): CreateProcess error=3, 
The system cannot find the path specified

What seems confusing to me is "\" before both path. I believe this may be the actual issue but i couldn't find anything to solve it

PS: My Android and Java EE apps work fine. and yes execution through command line also works

Edit 1: 1.Using Juno

2.this is what I get from

%PATH% C:\Python33\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;D:\android- sdk-windows\tools;C:\Program Files\TortoiseSVN\bin; C:\Program Files\Java\jdk1.6.0\bin; D:\android-sdk-windows\platform-tools;C:\Program Files\Mercurial;C:\Progra m Files\Apache-Subversion-1.7.2\bin;E:\Vishal\sw\dex2jar-0.0.7.11-SNAPSHOT\dex2j ar-0.0.7.11-SNAPSHOT;C:\Program Files\bin\repo;C:\Program Files\Git\cmd;C:\TomSe rve\apache-tomcat-7.0.29\bin;D:\Maven\apache-maven-3.0.4\bin

%JAVA_HOME%

C:\Program Files\Java\jdk1.6.0


Solution

  • This is not an actual answer but rather the last resort. I had to re-setup my development environment That includes fresh Java installation, Environment Variables and Eclipse.