• Register
0 votes

Problem :

I am learning Android Programming. Recently I upgraded the Windows OS and after that I reinstalled my Android studio 0.3.2. Currently I am using windows8.1 Pro.

If I try to run the android project I often face below error:

Cannot run program "C:\Program Files (x86)\Java\jdk1.7.0_40\bin\java" (in directory "D:\Android Stutio\system\compile-server"): CreateProcess error=2, The system cannot find the file specified

I am struggling with this error from past 4 days but still I am unable to fix it.

8 4 2
2,300 points

1 Answer

0 votes

Solution :

After installing a new windows os almost everybody goes through unexpected error.

Because most of the time we install all required softwares which we had earlier with same versions. So sometimes it’s the compatibility issue. But your problem looks easier to solve.  

You need to open a new commandline (by pressing Win+R => cmd.exe) and after that try to enter "java". I am very sure that you will get the error that is like "command not found". A reason behind this error is that you forgot to set an windows environment variable for your java.exe.

You can very easily set it by following below procedure

Go to  Win+X => System => Advanced System Settings => Advanced => Environment variables => then search for PATH under your system variables => edit => append the path to your latest in use java.exe separated by ;

For e.g.: ../other/pathes/with/file.exe;C:\Program Files (x86)\Java\jdk1.6.0_45\bin

Finally Save, close, and restart your box.

5 2 1
4,980 points

Related questions

0 votes
1 answer 561 views
Problem : I am completely new to the Notepad++ and C++ programming language. I am unable to figure out that what has gone wrong in my coding, may be it might look simple to resolved to many. I tried a lot to search for the solution, but without any ... NppExec script taken as below : NPP_SAVE CD $(CURRENT_DIRECTORY) Compiled.exe -c -w "$(FILE_NAME)" Please guide me in resolving this issue.
asked Dec 16, 2019 alecxe 7.5k points
0 votes
1 answer 177 views
Problem : Facing following git error cannot run program "git.exe": createprocess error=2, the system cannot find the file specified
asked Nov 13, 2019 peterlaw 6.9k points
1 vote
1 answer 102 views
Problem: I have recently started learning file handling with Python. I am currently having the folder which is full of pdf files. My task is to remove all the spaces from all the file names and then try to replace them with the underscores. Please find below the code ... my issue, but I have tried to look all over and still unable to find the solution for my above error related to file handling.
asked Jun 2 Martin K 6.6k points
0 votes
1 answer 9 views
Please I would like to know how I can solve this error during programming : filenotfounderror: [winerror 2] the system cannot find the specified file
asked Oct 23 psandprop 2.4k points
1 vote
1 answer 19 views
Problem: I have started learning java a few days earlier. I was doing good so far except I git the error: java.io.FileNotFoundException: (The system cannot find the file specified) I was trying to read a file from my system as an assignment but it’s not working in my ... System.out.println(reader.readLine()); } catch (IOException e) { System.out.println(e); } } } Thanks for your help, mate.
asked Apr 2 Gavin 15.3k points