[Q] Could not create Java Virtual Machine - General Questions and Answers

i m trying to install and use apktool.
I have downloaded
1.Android SDK
2.apktool
3. JDK (jdk-6u24-windows-i586.exe)
I read somewhere about changing environmental Variables.
my computer < Advanced < Environmental Variables< path
My current path entry is
C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem;C:\Program Files\Java\jdk1.6.0_24\bin\java.exe
Still i got the error.
my comp specs is
1 GB RAM
1.8 Ghz celeron processor
160 GB Hard disk
Pls guys help me. i did search here but i think i m the most dumb person to face this problem !

Na you are not dumb, just as lazy as the rest who could have used google to find out ;-).
But here you go:
Your path is wrong
C:\Program Files\Java\jdk1.6.0_24\bin;
dont point to java.exe just point to the bin directory, also it helps to include the path of the android sdk tools directory.
for example c:\android\tools;

Related

Testing ROM Images in the SDK Emulator!

I started looking at Android Development and got the whole Dev kit and the Eclipse enrionment setup and working fine.
The question I have is that I would try different apps I develop on the different ROMs available.
How do I get any of the new ROMs, like the HERO ROM ZIP files I can download to run in the emulator or is it even possible?
Im assuming that the system.img file in the SDK id the file I need to replace or re-create, but how is this done?
I am a noob to the develop stuff so step by step instructions would be much appreciated.
I also think this would be great for other developers and ROM makers to be able to test in this way.
Thanks
Simon
Hopefully THIS one dont get closed, it IS asking a development question...anyway,
I would like to know this as well. I would like to test things myself (getting better at manipulating them), and would like to know what he is asking as well.
Thanks.
I don't think this would work, as the ROMs are hardware depending, me thinks. Or at the least the kernel and drivers are.
maybe this will help, maybe not, just an emulator primer, so maybe people can jump on board with this
under <sdk path>/tools
to list out your AVD(android virtual device)
android list targets
will return:
Available Android targets:
id:1
Name: Android 1.1
Type: platform
API level: 2
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
id:2
Name: Android 1.5
Type: platform
API level: 3
Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
id:3
Name: Google APIs
Type: add-on
Vendor: Google Inc.
Description: Android + Google APIs
Based on Android 1.5 (API level 3)
Libraries:
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: HVGA (default), HVGA-L, QVGA-P, HVGA-P, QVGA-L
from here we choose our integer target, lets say 2
creating an AVD:
android create avd -n your_chosen_name_here -t 2
When you create an AVD, the android tool creates a dedicated directory for it on your development computer. The directory contains the AVD configuration file, the user data image and SD card image (if available), and any other files associated with the device. Note that the directory does not contain a system image — instead, the AVD configuration file contains a mapping to the system image, which it loads when the AVD is launched.
By default, the android tool creates the AVD directory inside ~/.android/avd/ (on Linux/Mac), C:\Documents and Settings\<user>\.android\ on Windows XP, and C:\Users\<user>\.android\ on Windows Vista
Click to expand...
Click to collapse
to run your newly created AVD:
emulator -avd your_chosen_name_here
maybe this will help, but I'm guessing everyone here already knows all of this.
references:
http://developer.android.com/guide/developing/tools/emulator.html#starting
Yeah, I understand that you can specify the AVD.
The only thing now is to edit the AVD to point to a different image. This is easy!
The system image file is a *.img file.
So how do we get our ROM images compiled into the IMG file format?
There must be a tool, but I cant find anything.
And what hardware does the emulator, emulate? Maybe it ignores the hardware specific calls throu an API so the ROM image target hardware shouldn't matter.
I just started messing around with rom's and after I build one I put system.img userdata.img and ramdisk.img from my /mydroid/out folder into the sdk's image folder and start the and it uses the new rom when I start the emulator
thats the easy part
do a nandroid backup
copy the sdk/platforms/android-1.5
to something like sdk/platforms/MINE
go to your AVD directory AVD/whateveryoucalledit
open up the config.ini
edit:
skin.name=HVGA
skin.path=platforms\MINE\skins\HVGA
image.sysdir.1=platforms\MINE\images\
go to your nandroid backup on your sdcard
copy system.img
go to sdk/platforms/MINE/images/
and paste the nandroid system.img
now run your AVD and it will boot that system.img
im running CyanogenMod rom right now in the emulator
hint* number pad 7 with numlock off in the emulator is how to open up the hardware keyboard
Awesome. I'll be giving this a try later.
One question: The apps are in the system.img file on the SDK images as far as I can tell. What do you do with all the apps in the new ROMs?
whatever you want to do with them, they're all there, even android market works perfectly
And where are you guys getting the system.img file from?
The ROM zip files dont have them.
Sorry....Im noob to this. LOL
ggolemg said:
whatever you want to do with them, they're all there, even android market works perfectly
Click to expand...
Click to collapse
OK, Im confused. Can you just unzip the ROM files and place in the folder that you point using the same folder structure?
OR
Do you have to have a system.img ?
Another thought:
I dont want to have to install all the ROMs just to create a Nandroid backup to get the images. There must be a way to create the images from the raw files in the ZIP files.
Any ideas?
UPDATE: The same technology used by Nandroid itself!
The google android emulator included in the google android sdk is limited. Although you can use 'adb push' to upload more tools, but one has to do it again next time. Follow the steps to create a enhanced system.img:
1. system.img is yaffs2 flash file system, so firstly you need the mkfs.yaffs2 tool, download it in the following link: Release Android Yaffs2 Tool (Both X86 And ARM). One has to be a registered user to download the tools.
2. use the 'adb push' to upload tools to android emulator, executables in /system/bin/, libraries in /system/lib, one can also create folder. One need change the file mode necessary.
3. upload the ARM mkfs.yaffs2 tool, use the following command to create system.img: # mkfs.yaffs2 /system /system.img
4. download the system.img to local with command 'adb pull', replace the system.img in your emulator folder/tools/lib/images/
Click to expand...
Click to collapse
so it seems like it would be just as much fun doing a nandroid backup
*edit*
so now the real question is, how do we go about ripping out the nandroid functionality to be able to do this locally?
*edit 2*
it is the mkfs.yaffs2 tool
Usage:
mkfs.yaffs2 yourdir yourimage
Ohsaka said:
NANDROID - CYGWIN DIRECTIONS (not not not, I repeat, not fully tested and verified yet)
Changes so far if you are using cygwin:
1) Make sure you have the 'netcat' and 'gcc' packages, else just run cygwin.exe again and get them.
You can test if you have them by running 'which nc' and 'which gcc', both commands should return /usr/bin/<command>
2) Compile the mkyaffs2image executable.
Inside the extracted nandroid archive directory, goto the tartools\yaffs2\utils\ directory (inside a cygwin prompt) and type 'make'.
This should generate a file named "mkyaffs2image.exe" which you need to place somewhere on your path.
(Hint: If you haven't downloaded the Android SDK, abort now. Wait for more explicit directions... Else, place the .exe where adb is, since it should be on your path already)
3) Edit the nandroid.sh script. (else you get a permission denied error when the script tries to run the dump_image-arm file)
Find the line:
adb push ./$tool /cache/$tool
Add the following line after it:
adb shell chmod 777 /cache/$tool
4) Make a managed mount named /tmp (else windows will puke on the long unix filenames with colons, etc)
mkdir /tmp
mount -o managed c:/cygwin/tmp /tmp (Note: change c:/cygwin to be the directory cygwin was installed to, you can find it by typing 'cd /' and then 'explorer .')
5) Follow the standard "tar + mkyaffs2image" directions to generate the last three .img files. They refer to the /tmp directory which you created in the previous step.
Viola! Looks like I have a complete backup image now...
$ ls -l
total 117504
-rw-r--r-- 1 Osaka None 2621440 Jun 12 21:31 boot.img
-rw------- 1 Osaka None 737088 Jun 12 22:07 cache.img
-rw------- 1 Osaka None 53570880 Jun 12 22:06 data.img
-rw-r--r-- 1 Osaka None 262144 Jun 12 21:31 misc.img
-rw-r--r-- 1 Osaka None 5242880 Jun 12 21:31 recovery.img
-rw------- 1 Osaka None 57885696 Jun 12 22:06 system.img
Now I just need to drink up the courage to test it on my phone!
Click to expand...
Click to collapse
ggolemg said:
so it seems like it would be just as much fun doing a nandroid backup
*edit*
so now the real question is, how do we go about ripping out the nandroid functionality to be able to do this locally?
*edit 2*
it is the mkfs.yaffs2 tool
Usage:
mkfs.yaffs2 yourdir yourimage
Click to expand...
Click to collapse
Is this for Linux (which I don't have) and if so, is there a Windows version?
short answer: yes its only for linux
long answer is a plea for help i posted in the nandroid thread about it:
I was wondering if there was a method to use the yaffs3 command to make a system.img from an unzipped rom placed on the sdcard through ADB, from what I've seen nandroid is almost exactly what I'm after.
The issue of why I can not just do this through linux, i can. I just want to be able to do it through windows some way without loading the entire rom on the phone and nandroiding the system.img out.
Either the aforementioned method, or the ability to mount a portion of my computers hard drive as a recognizable mountable partition within android running on the usb connected phone, loading the rom on that partition, unzipping it there, running ADB and making the system.img. But this way seems to bring up more problems than it's worth.
Or.. running the make yaffs3 command through ADB running the emulator with the rom unzipped on the virtual sdcard. This would actually be the best option as it would not require an actual phone.
I hope someone can help. Thank you very much.
Click to expand...
Click to collapse
hopefully someone knows the answer, I'm still trying though.
so on windows we would adb push the update.zip to the sdcard on the emulator
unzip it on the sdcard, there are apps for that
adb shell mkfs.yaffs2 sdcard/<extractedzipfilename>/system/ sdcard/system.img
adb pull the newly created system.img and proceed to load it in the emulator
i know im missing a ton here, please someone correct me
I'd love to be able to run these images in the emulator on windows!
ggolemg said:
thats the easy part
do a nandroid backup
copy the sdk/platforms/android-1.5
to something like sdk/platforms/MINE
go to your AVD directory AVD/whateveryoucalledit
open up the config.ini
edit:
skin.name=HVGA
skin.path=platforms\MINE\skins\HVGA
image.sysdir.1=platforms\MINE\images\
go to your nandroid backup on your sdcard
copy system.img
go to sdk/platforms/MINE/images/
and paste the nandroid system.img
now run your AVD and it will boot that system.img
im running CyanogenMod rom right now in the emulator
hint* number pad 7 with numlock off in the emulator is how to open up the hardware keyboard
Click to expand...
Click to collapse
Hm, the emulator just hangs on the ANDROID.. message, similar to when the standard system.img was in.
anyone figure out how to do this on a mac?
thanks if anyone can.
johnnylicious said:
anyone figure out how to do this on a mac?
thanks if anyone can.
Click to expand...
Click to collapse
I found this somewhere else and take no credit for it. I did shorten the steps.
Of course this is once you have the sdk installed on your mac
1. Run Terminal, and change to the 'tools' directory of the SDK (or add the tools directory to the path settings in ~/.profile).
2. Type './android list target'
3. Note the 'id' number of the '1.5' target (in my case it's '2')
4. Type './android create avd -n enhanced -t 2' (substitute 2 with the target number determined above if required)
5. You will be prompted to create a hardware profile. {You can leave as default no}
6. Use nandroid to create a backup then copy system.img
7. Copy file to ~/.android/avd/enhanced.avd/system.img
8. You're ready! Type './emulator -avd enhanced' to run! Note: inital boot may take a few minutes!
Can anyone post up the
Android Yaffs2 Tool (Both X86 And ARM)
for download? The above link doesn't work. I did a google search and all the D/L links are referring to the same location.
thanks!

[Q] help installing Android SDK

okay, so there is a bug in the custom ROM that i put on my phone and it requires some ADB commands to fix
i am trying to install Android SDK to get ADB, but it tells me that i need to install Java JDK
so i've downloaded the 6u23 version of JDK for my windows x64, and installed it ... and i ran the Android SDK installer again, and it still says that i dont have Java JDK installed
how do i install the Android SDK?
right, so i've downloaded the Android SDK zip file , and adb.exe is not under the /tools folder
where can i get adb.exe??
use path to find java
I think you need to add to your environmental variables in the line "path" append to the back end of it < ;path to java>. The path to java may be like C:\Program Files\Java.
You get to environmental variables by going Control Panel > System > Advanced Settings.
donob09 said:
I think you need to add to your environmental variables in the line "path" append to the back end of it < ;path to java>. The path to java may be like C:\Program Files\Java.
You get to environmental variables by going Control Panel > System > Advanced Settings.
Click to expand...
Click to collapse
I've got the same issue. No matter what I try I can not get SDK to recognize the fact that JDK 6u23 is on the Vista_64 I'm running.
I've tried to edit the system variable path, but I must be missing something. I'm not really sure of the proper commnad string, and there are even a couple of places that look attempt worthy, so that is what I did, I edited the path, rebooted and still nothing, undid that change and tried it uncer environment variables, still nothing. So I've gone back and undone the changes. Any details on the editing process you suggest might just to the trick. Thanks for helping a nub.
EDIT: Ok, here is what worked for me: In the advanced system settings, environment variables, I noticthed that the CLASSPATH had the path string commenced with "." and ";" thats a dot and a colon. i.e. .;C:\Program Files\Java... This was something that windows or oracle or some sub-routine must have put in place. I certainly didn't them there. I decided to delete the two special charaters so the string for my is set thus: CLASSPATH C:\Program Files\Java\jre 1.6.0... After I changed it, I ran the windows installer and the program went right through, reported finding JDK and intalled the components in SDK. What a relief cuz I was high centered on a rock. Glad I noticed that and deciede to take a hack at it. Just lucky I guess.... Cheers all!

[Q] Android ADK and 64 bt ubuntu - please help

Ok, so I've a newly installed 64bit ubuntu, and I've just downloaded the android SDK.
I managed to run the "android command the first time round whereby I successfully downloaded android versions 2.3+
I was very clever and did this through the terminal, by going in to my android SDK directory, and then tools (for me cd /android/tools)
and then I typed android, and the gui came up..... all good.
I then decided I needed to add this directory to my path, I did some jiggery pokery here, not too much, but I cant say exactly what I did, but now, when I try to run the android command, from the correct directory all I get is the following:
Code:
[email protected]:~/android/tools$ dir
adb_has_moved.txt dmtracedump hprof-conv NOTICE.txt zipalign
android draw9patch layoutopt proguard
ant emulator lib source.properties
apkbuilder etc1tool mksdcard sqlite3
ddms hierarchyviewer monkeyrunner traceview
[email protected]:~/android/tools$ android
android: command not found
I know this must be down to some kind of path error, but i'm lost as to how to correct it. I've googled all over, but every explanation seems geared towards someone with more linux knowledge than mine. Please may someone explain really simply how I fix this? thanks

[Q] cannot run MyFirstApp on windows 7 with adb and AVD

It seems it is not an easy thing to start android development. I followed the official instruction and tried to run the MyFirstApp example from developer.android.com on my Windows 7 64bit machine with AVD. But after 2 days effort, I am still cannot make it work for me in Eclipse and in adb command line.
The best I reached in command line approach is the following -- the second block with italic words shows the error I got:
Code:
E:\Workspace\MyFirstApp>ls bin
AndroidManifest.xml build.prop
AndroidManifest.xml.d classes
MyFirstApp-debug-unaligned.apk classes.dex
MyFirstApp-debug-unaligned.apk.d classes.dex.d
MyFirstApp-debug.apk dexedLibs
MyFirstApp.ap_ proguard.txt
MyFirstApp.ap_.d res
[I][B]E:\Workspace\MyFirstApp>adb install bin\MyFirstApp-debug.apk
failed to copy 'bin\MyFirstApp-debug.apk' to '/data/local/tmp/MyFirstApp-debug.a
pk': No such file or directory
rm failed for /data/local/tmp/MyFirstApp-debug.apk, No such file or directory[/B][/I]
I hope somebody can help me about these:
1. I am in Windows with AVD, why adb want to find /data/local/tmp, which is linux style location?
2. where does the adb try to copy the apk file to? My SDK is installed under "C:\Users\myname\AppData\Local\Android\android-sdk". There is no space in the address path. The source apk file is ready and should not be the cause of that error, I think.
3. Any configuration of the installed SDK needs to be modified in Windows machine? I think the SDK manager should be able to figure out what the machine is and download/install appropriate components for the user. Is that right?
I have similar or the same issue by using Eclipse.
thanks,

Run Oracle's Arm Jdk On Phone

Hi,
I would like to run Oracle's Jre for Arm on my Samsung I5500 with Froyo 2.2. The phone is rooted. I have unziped and copied files into /data
When I try to invoke java binary (or any other from bin directory), i get this:
/data/jre7soft/bin # ./java
ash: ./java: not found
"soft" is short from Soft Float ABI, but I was also trying with Hard Float ABI (i couldn't find which one to use with my cpu), every time the same result. The message "not found" is strange, the files of course exists in the directory, they have executable flag set.
Could anyone help me, pls?

Categories

Resources