Error running javac.exe when compiling an Android example. Environment variables not present

edited February 2014 in Android Mode

When I try to compile an example that came with the code I get the Error running javac.exe and I know this has been answered to death. I see you need to edit the environment variables for ANDOID_HOME, JAVA_HOME, ANT_HOME, and ADB_HOME, but they are not in the PATH variable and are not listed any where else. I am unsure of the process to create an environment variable, do I simply put the path in the PATH variable? Do I need to create a whole new variable?

This is what my PATH variable reads "%CommonProgramFiles%\Microsoft Shared\Windows Live;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;c:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;c:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;c:\Program Files (x86)\Common Files\Roxio Shared\12.0\DLLShared\"

Answers

  • You don't need to create a new variable (I'm fairly certain...), but it is recommended to maintain readability . To add a value to PATH, add a semicolon and then the absolute path to the target directory.

    If you want to create a new variable, there should be a button labelled something along the lines of "New Environment Variable". After selecting this, enter a name such as "JAVA_HOME" and the absolute path. To add this to the PATH variable, add a semicolon and then the name of the variable surrounded by percent signs (%).

    Example:

    PATH
    %JAVA_HOME%;%ANDROID_HOME%
    
    JAVA_HOME
    C:\path\to\JDK\bin\
    
    ANDROID_HOME
    C:\path\to\Android\
    

    etc.

  • I was able to set the JAVA_HOME variable but was not able to set up the ANDROID_HOME as I am a bit confused on the path as there is no bin folder in my adt-bundle-windows-x86_64-20131030 folder nor is the a ANT folder. Am I looking in the wrong place?

Sign In or Register to comment.