Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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