5

I downloaded new Android and Eclipse bundle in my new notebook (Window 7 64 bit) then I open my old files that I used to work in PC.When I open, it shows some error about version API and that I should fix it in SDK Manager, But when I try to open the SDK Manager it won't run and shows this error in console.

[2555-11-20 10:27:27 - Dex Loader] SecurityException: Unable to find field for dex.jar
[2555-11-20 10:36:02 - SDK Manager] [SDK Manager] Failed to convert path to a short DOS path: C:\Windows\system32\java.exe

How can i fix that ??

Ron
  • 24,175
  • 8
  • 56
  • 97
DrNutsu
  • 475
  • 2
  • 10
  • 21

5 Answers5

10

In android_sdk\tools\lib there's a batch-file called find_java.bat. It calls find_java.exe -s to find a list of potential Java locations. Running the exe file like this returns the error I've been seeing:

Failed to convert path to short DOS path: c:\windows\system32\java.exe

-s stands for short. Running it without the -s causes find_java.exe to work, causing find_java.bat to work, causing everything else to work. So the fix was to edit find_java.bat, and remove the -s .

Baby Groot
  • 4,637
  • 39
  • 52
  • 71
Freak
  • 6,786
  • 5
  • 36
  • 54
  • Thanks that work!! edit the find_java file and remove in " for /f %%a in ('%~dps0\find_java.exe') do set java_exe=%%a " – DrNutsu Nov 20 '12 at 04:37
  • Source? http://www.howto-gethelp.com/2012/11/eclipse-android-sdk-bundle-can-open.html – nuala Nov 30 '12 at 14:49
  • This doesn't work for me. The other answer from @Yugandhar works i.e. running the `android.bat` file – Nam G VU Aug 22 '13 at 06:57
  • @NamG.VU so thats why you voted it down? Btw this is ridiculous as it worked for many of other people.No solution work in every situation and here we just give the most probable right answer (not 100% ACCURATE) and this thing is called troubleshooting.BTW you have rights of down voting so i say nothing.You are open to put your opinion.thanks – Freak Aug 22 '13 at 10:48
  • @NamG.VU it doesn't mean that you should down vote answer like this who already have such upvotes. – Freak Aug 23 '13 at 08:20
8

Try this:

  1. go to adt-bundle-windows\sdk\tools

  2. Right-click on android.bat and say "Run as Administrator"

It will open up the sdk manager.

Nam G VU
  • 33,193
  • 69
  • 233
  • 372
Yugandhar
  • 199
  • 4
0

Removed all existing eclipse & android versions

I downloaded latest version of eclipse & latest android SDK ..and installed them..

Took me 30 mins which was better than being stiuck for more than 3 days even after trying all procedures mentioned in various blogs & links...

Try above as the last option

Satish
  • 1
0

Need help with SDK it boots up but the dos flashes open and closes fast. I installed the 7.1 79 Java on my Windows 32 bit desktop. I installed the Android and Eclipse bundle. I tried running android.bat by administrator. I tried this for Windows.

You need to create an environment variable called JAVA_HOME and set it to your JDK installed directory.

First, take note of your JDK installed directory. The default is c:\Program Files\Java\jdk1.8.0_{xx}, where {xx} is the latest upgrade number. It is important to verify your JDK installed directory, via the Computer, before you proceed further.

Start a CMD shell, and issue the command set JAVA_HOME to check if variable JAVA_HOME has been set:

> set JAVA_HOME

Environment variable JAVA_HOME not defined If JAVA_HOME is set, check if it is set to your JDK installed directory correctly. Otherwise, goto next step.

To set the environment variable JAVA_HOME in Windows 2000/XP/Vista/7/8:

Push Start button ⇒ Control Panel ⇒ System ⇒ (Vista/7/8) Advanced system settings ⇒ Switch to "Advanced" tab ⇒ Environment Variables ⇒ System Variables ⇒ "New" (or "Edit" for modification) ⇒ In "Variable Name", enter "JAVA_HOME" ⇒ In "Variable Value", enter your JDK installed directory (e.g., "c:\Program Files\Java\jdk1.8.0_{xx}").

To verify, RE-START a CMD shell (need to refresh the environment) and issue:

set JAVA_HOME

I also tried opening the android.bat and editing it with my java 7.1.79.

Piotr Olaszewski
  • 6,017
  • 5
  • 38
  • 65
  • I tryed all of that im really lost – user5221652 Aug 13 '15 at 02:47
  • I've been doing a lot of reading and copping for like a week now I tryed unistalling the bundle several times and java I put the java in root several times im really lost please any thing . – user5221652 Aug 13 '15 at 02:54
0

If you have Android studio loaded it kills the contents of the ~/android.bat and most other files in the sdk directory that the SDKManager needs to run. I had to install the Android SDK in a secondary directory, then copy over the contents into my actual SDK directory. This allows the SDKManager in Eclipse to function again and keeps your SDK updates. If you install Eclipse after installing Android Studio, then this problem does not occur.

darrellh
  • 11
  • 1