Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to get Eclipse to compile and run a HelloWorld class but it can't even do that. I have installed Eclipse x86 SDK 4.2.0 together bit with the latest JRE and JDK both in 64 bit as well. I also have the PATH variables set to respond to command prompts. When I try to run the following code:

class HelloWorld {
    public static void main(String[] args)
        {
            System.out.println("Hello World!" ) ; 
    }
}

And it returns the following error:

Exception occurred executing command line. Cannot run program "C:\Program Files\Java\jre7\bin\javaw.exe" (in directory "C:\Users\Default\workspace\devs"): CreateProcess error=5, Access is denied.

Can you help me fix this? Thanks!

share|improve this question
up vote 0 down vote accepted

You have to add the following entry to your eclipse.ini file:

-vm
C:/Prog/Java/jdk1.6.0_21/jre/bin/server/jvm.dll

Make sure you replace the version number with yours and backup the original eclipse.ini file in case of trouble and copy the lines above into the file BEFORE the --vmargs argument. If not, Eclipse will crash.

Follow this link for more information: http://www.eclipse.org/forums/index.php?t=msg&goto=559997&S=a4836b4add35f1ac144df946cb1ef64d

share|improve this answer
    
Thank you @neo1987 ! For anyone with the same problem let me spare you the trouble of editing it wrong: Backup the original eclipse.ini file in case of trouble and copy the lines above into the file BEFORE the --vmargs argument. If not, Eclipse will crash. Thanks again and happy coding!! – Eduardo de Luna Sep 22 '12 at 2:20
    
Thanks @EduardodeLuna! I have added your lines to the answer. – vahissan Sep 22 '12 at 3:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .