Tuesday, March 18, 2014

ANDROID WEEK DAY 1

Thanks to you all that attended the event yesterday, and please bear it in mind that it continues on Monday, 17th March 2014.

This post is for everyone who couldn't get their JAVA code to compile using command prompt, if the following steps are followed carefully, you should be able to run your lines of code and get the result(s) of your program. Also, steps for fixing the Android Studio error when you start the application are listed so please, read on;

For Android Studio: 

Step 1: Open File Explorer, right-click on This Pc and click properties.


Step 2: In properties, click on Advanced system settings.


Step 3: In Advanced system settings click on Environment Variables.


Step 4: In Environment Variables, click New;


Step 5: Then locate the "JAVA" folder in Program Files on your main Drive. Next, click the jdk<version> folder and copy the address in the address bar.



Step 6: Paste the copied address in the "Variable Value" as shown in the image below, and name the Variable name "JAVA_HOME".


Step 7: Click Ok and close the Environment Variables Window, launch your Android Studio now and it should work without any glitch.

For Command Prompt:

Follow the above steps through from 1-4, then; goto your JAVA folder in Program Files, open the jdk<version> folder, open the bin folder, copy the location in the address bar.


Go to your Environment Variables and set the Variable Name to "PATH"(without quotes), then paste the copied address in the Variable Value box. 


Click Ok and close Environment Variables, open command prompt and you can run your code effectively.

Tip; To run JAVA programs with command prompt, compile first by typing "javac filename.java"(without quotes and filename is the name of your written java source code. Then run the program now by typing "java filename")
 Thanks for reading, don't forget to share this post and comment if you have issues, we'd be glad to help out. :)

Related Posts

4/ 5
Oleh

Subscribe via email

Like the post above? Please subscribe to the latest posts directly via email.