1

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!

0

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

|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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.