• Register
0 votes
271 views

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

Please log in or register to answer this question.

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

1 vote
1 answer 5 views
5 views
Problem : I came across this issue > CreateProcess() failed with error code 2: The system cannot find the file specified.
asked 6 days ago Abik Dey 4k points
0 votes
1 answer 12 views
12 views
Problem: I am unable to find out the solution, Please solve it : createprocess error=2, the system cannot find the file specified.
asked Mar 27 ashik 14.6k points
0 votes
1 answer 1.3K views
1.3K 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 369 views
369 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
0 votes
2 answers 8 views
8 views
problem: help me to fix the problem [error 2] the system cannot find the file specified.
asked Apr 16 ashik 14.6k points
0 votes
1 answer 3 views
3 views
problem: i am unable to find error 2 the system cannot find the file specified
asked Apr 16 ashik 14.6k points
0 votes
1 answer 6 views
6 views
Problem: Need someones help,cannot run program "git.exe": createprocess error=2, the system cannot find the file specified
asked Apr 13 jamuna1 30.2k points
1 vote
1 answer 309 views
309 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, 2020 Martin K 6.6k points
0 votes
1 answer 207 views
207 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, 2020 psandprop 2.4k points
0 votes
1 answer 43 views
43 views
Problem : While running the app on a virtual device (AVD) created on Android studio (in a Windows 10), I am getting below error and panic. Emulator: PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT Emulator: Process finished with exit code 1 I have already defined the ANDROID_SDK_ROOT in my environment variables. Can anyone please explain me how to resolve above problem?
asked Mar 6 Wafa Abu Yousef 6.1k points