reference:http://blog.csdn.net/qq305013720/article/details/8934152
There are currently three solutions for the implementation of studio.bat error causes Android studio to not run , and finally it is different . : The first method I used
1. Change the virtual machine configuration file studio.exe.vmoptions
Some say it is a Java environment variable , if not set
http://blog.csdn.net/huanghm88/article/details/3965218
Because eclipse is always in use, the environment variables should be OK!
Then I went into the installation directory of Android studio (the directory I chose when I installed it, my default C:\Documents and Settings\ user name \local Settings\Application Data\android\ Android-studio\bin) found that the bin directory has a lot of bat batches running Studio.bat hints
Unrecognized VM option ' +usecodecacheflushing ' Could not create the Java virtual machine
Decisively found in the bin directory of the above installation directory
For Windows 32:
studio.exe.vmoptions file , remove the line containing the usecodecacheflushing
For Windows 64:
studio.exe.64vmoptions file , remove the line containing the usecodecacheflushing
Ubuntu 32:
studio.vmoptions file , remove the line containing the usecodecacheflushing
Ubuntu 64:
studio64.vmoptions file , remove the line containing the usecodecacheflushing
re-run Android Studio Finally, there's an exciting picture.
discover other solutions on the Web:
2. Modify the batch processing studio.bat
solve the problem of the next 32-bit Win7 system.
go to the console, CD to Android-studio\bin directory, execute Studio.bat
View the error message.
1. There is a situation on the Internet is not found Javahome, the description may be the JDK environment variable problem, you can go in the computer advanced system settings inside to see the next
2. My personal experience is that unrecognized VM option ' +usecodecacheflushing ' Could not create the Java virtual machine
I can't create a virtual machine, my Java environment variable is already set.
Open With Text tool
Studio.bat
Line25 To line:
SET jre=%jdk%
IF EXIST "%jre%\jre" SET jre=%jdk%\jre
SET bits=
IF EXIST "%jre%\lib\amd64" SET bits=64
can see inside set software support system bit number is 64 bit, and my own computer is 32 bit Jre/lib directory only i386 file
try to put
IF EXIST "%jre%\lib\amd64" SET bits=64 change to
IF EXIST "%jre%\lib\i386" SET bits=32
3. It is also Modify Batch processing Studio.bat, change the place.
For 32-bit XP systems
SET bits=
instead SET bits=32
64-bit system does not change
PS: for the netizen question usecodecacheflushing what meaning, find the following explanation
http://blog.codecentric.de/en/2012/07/useful-jvm-flags-part-4-heap-tuning/
-xx:+usecodecacheflushing
If The code cache grows constantly, e.g., because of a memory leak caused by hot deployments, increasing the code Cach E size would only delay its inevitable overflow. To avoid overflow, we can try a interesting and relatively new option:to let the JVM dispose some of the compiled code W Hen the code cache fills up. This is the specifying the flag-xx:+usecodecacheflushing. Using This flag, we can at least avoid the switch to interpreted-only mode when we face code cache problems. However, I would still recommend to tackle the root cause as soon as possible once a code cache problem have manifested its Elf, i.e., identify the memory leak and fix it.
probably meaning this option is used to avoid the code cache overflow problem, if you feel wrong can be two other solutions, I did not find the problem
But I made a mistake when I first generated the project file, but I don't know what the problem is yet.