• 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

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

0 votes
1 answer 851 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 242 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 177 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 48 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 6 views
0 votes
1 answer 13 views
I'm wondering what I am doing wrong?
asked Jan 3 TeamScript 9.5k points
0 votes
1 answer 13 views
Problem: when I run, I get this error: C:\Users\User\Documents\Workspace\FileRead\hello.txt Error: hello.txt (The system cannot find the file specified) my FileRead.java and hello.txt where in the same directory that can be found in: C:\Users\User\Documents\Workspace\FileRead I'm wondering what I am doing wrong?
asked Dec 2, 2020 Mashhoodch 5.6k points
1 vote
1 answer 21 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, 2020 Gavin 15.3k points
0 votes
1 answer 359 views
Problem : I am currently working with arduino nano and facing following error avrdude: ser_open(): can't open device "\\.\com1": the system cannot find the file specified.
asked Nov 14, 2019 peterlaw 6.9k points
0 votes
2 answers 5.2K 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 Jan 23, 2020 jwilliam 3.9k points