Related
The Absent-Minded Professor and I just installed adb on Ubuntu; here is how to set up adb on Ubuntu Linux, Gutsy through Maverick.
Our port of the BX theme to CM6 stable is forthcoming.
first command after installing and updating sdk and extracting the tgz file to your home directory is== sudo gedit /etc/udev/rules.d/70-android.rules
NOTE: In the above file replace ## with the number 50 if you are running Gusty/Hardy/Dapper (50-android.rules) or with the number 70 if you are running Karmic Koala/Lucid Lynx(70-android.rules
after the window pops write this in the file==SUBSYSTEM==”usb”, SYSFS{idVendor}==”0bb4″, MODE=”0666″ then save and close
the follwing commands is== sudo chmod a+rx /etc/udev/rules.d/70-android.rules
Then reboot.
Open a terminal and type== sudo gedit .bashrc
The file contents should be as follows== export PATH=${PATH}:~/home/user/android-sdk-linux_86/tools
Save and close.
Run the command== adb devices
If you see a serial number like this:
List of devices attached
HT99PHF02521 device
then you are done.
If you get error messages such as "no such command," cd to /home/user/android-sdk-linux_x86/tools and use the adb commands in this way:
./adb devices
./adb shell
etc.
If you get an error message here referencing insufficient device permissions, do the following:
./adb kill-server
sudo ./adb start-server
Now ./adb devices should work.
Courtesy of laie1472 and The Absent Minded Professor
Thanks to Esau Silva (http://esausilva.com/2010/05/13/setting-up-adbusb-drivers-for-android-devices-in-linux-ubuntu/) and Tobias Eisentrager (http://www.mail-archive.com/[email protected]/msg14211.html).
Hi everyone, yesterday i finally found a way to connect my PC with Fedora 15 and the Acer Iconia A500. Now I am able to transfer file directly from my PC to Acer, and vice versa.
With Android Honeycom to connect tablet with PC i need MPT (media transfer protocol) support, I surfed on internet and I found this two post:
[Guide] Mount Internal Storage in Ubuntu: wrote for Motorola Xoom;
zen vision m 60gb (mtpfs, libmtp, amarok, gnomad2): wrote for zen vision m 60gb
and I decided to write a guide to connect Acer Iconia to Fedora 15
First of all, we need to install all the dependencies with:
Code:
sudo yum install gcc-c++ gcc
sudo yum install libmtp libmtp-devel libnjb libnjb-devel
sudo yum install libid3tag libid3tag-devel glib2 glib2-devel fuse fuse-libs fuse-devel libmad libmad-devel
Now download mtpfs_0.9.orig.tar.gz from www.adebenham.com/mtpfs/, on internet there's Fedora package but it did't work for me.
Now we have to unpack it with:
Code:
tar -xzf mtpfs_0.9.orig.tar.gz
move into directory:
Code:
cd mtpfs-0.9.orig
lauch this commands:
Code:
./configure
make
sudo make install
Now we have to create a directory where we will mount acer's internal disk:
Code:
sudo mkdir /mnt/acerIconia
sudo chown user:user /mnt/acerIconia
replace user:user with your user. Create a file called acerIconiaMount in /usr/bin and put the line:
Code:
mtpfs -o allow_other /mnt/acerIconia
now we have to give it execute permission:
Code:
sudo chmod a+x acerIconiaMount
Now we have to reboot. When Fedora boot open terminal and launch:
Code:
/usr/bin/acerIconiaMount
and we can access to Acer's internal disk from /mnt/acerIconia. To unmount the Acer's internal disk we have to launch:
Code:
fusermount -u /mnt/acerIconia
Quite simple, isn't it? ;-)
Bye Alberto
Ok so this is a guide that me and my friend made for compiling ROMs for our LG-P350 Now, this is pretty much universal and can be used for general development
This is the stuff you will need :
Ubuntu-can be found on the Ubuntu website http://www.ubuntu.com/start-download?distro=desktop&bits=64&release=lts (this is a direct link to the Ubuntu 12.04 64-bit version)
Python (included)
GNU Make
Java Development Kit (JDK) 6
Git
Before you can do anything you need to install Ubuntu. You can go with newer versions but i still think that 10.10 is best and this guide is adapted to it. You can install it like dual boot or use Wubi (Windows Ubuntu Installer). However if you choose Wubi there is a good chance that you won't have enough storage, so that's not recommended.Those who want to dual-boot check out this post http://forum.xda-developers.com/showpost.php?p=34669858&postcount=26
NOTE: You can do this in a virtual machine (for example VM Ware and Virtual box) but it will be a lot slower unless you have a VERY strong CPU and a LOT of RAM.
Generally Python is not needed since it's already in Ubuntu. However if you want to install it separately here's how:
First of all open the terminal. Now copy/paste these codes (one by one) and execute them:
Code:
sudo apt-get install build-essential gcc
cd Downloads
wget http://www.python.org/ftp/python/2.5.6/Python-2.5.6.tgz
tar -xvzf Python-2.5.6.tgz
cd Python-2.5.6
./configure --prefix=/usr/local/python2.5
make
make test
sudo make install ([B]NOTE[/B]: [I]You will be asked for your password, enter it and press enter[/I])
sudo ln -s /usr/local/python2.5/bin/python /usr/bin/python2.5
Now you need Sun JDK 6. Same procedure as with Python:
Code:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
For those who get package error try these:
Code:
sudo add-apt-repository ppa:sun-java-community-team/sun-java6
sudo apt-get update
sudo apt-get install sun-java6-jdk
sudo update-java-alternatives -s java6-jdk
Now that JDK is installed it's time for GNU Make:
First of all download GNU Make from link given. Download version 3.82
Now extract the downloaded file to your Home directory.
Go to Home directory and change the name of GNU Make To make
Now open the Terminal and type the following codes
Link: http://ftp.gnu.org/gnu/make/
Code:
cd make
./configure
sudo make install
Now make is installed.
Next, we are going to install the dependencies:
FOR UBUNTU 10.10
Codes to type in terminal :
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \ zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \ x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \ libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \ libxml2-utils xsltproc
export USE_CCACHE=1
If that method didn't work then try this:
You use the same commands BUT the first one is:
sudo apt-get install git-core gnupg flex bison gperf build-essential
Now it should download some stuff. When its done you need to do the same for the rest in the right order.
NOTE: Since I don't remember the right order i will just put the commands how they should be written if you get error read what's missing and put that in first.
Here are the rest of the lines:
Code:
sudo apt-get install zip curl
sudo apt-get install zlib1g-dev
sudo apt-get install libc6-dev
sudo apt-get install lib32ncurses5-dev
sudo apt-get install ia32-libs
sudo apt-get install x11proto-core-dev
sudo apt-get install libx11-dev
sudo apt-get install lib32readline5-dev
sudo apt-get install lib32z-dev
sudo apt-get install libgl1-mesa-dev g++-multilib
sudo apt-get install mingw32
sudo apt-get install tofrodos python-markdown
sudo apt-get install libxml2-utils
sudo apt-get install xsltproc
FOR UBUNTU 12.04
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Now for the Android SDK, ADB and ADB path:
1. SDK (Software-Development-Kit) :
Go to this link and download the Android SDK for Linux:
http://developer.android.com/sdk/index.html
After downloading it, extract it to the Home folder. You can probably extract where you want and change all the steps below to to fit your set up, but I like putting it in Home folder.
When you have extracted it in the Home folder change the name of the folder of android-sdk-linux to sdk.
Then open the Terminal and run these codes:
Code:
cd ~/sdk/tools/
./android sdk
When you run this, a window will pop up. For this you only need "Android SDK Tools" and "Android SDK Platform-tools". Just check these two and install them.
2. ADB (Android-Debug-Bridge):
Run this command to see if your ADB works. You have to have your android device connected in debugging mode.
Run these codes in the Terminal :
Code:
cd ~/sdk/platform-tools ./adb devices
When you entered the codes above, you should see something similar to this:
List of devices attached 0123456789ABCDEF device
NOTE: If you see output like given bellow we need to give the device permissions. Don't worry I had this too when I set my computer up for the first time.
List of devices attached ???????????? no permissions
Here is how we fix it:
Open the Terminal and type this:
Code:
gksudo gedit /etc/udev/rules.d/51-android.rules
After you've entered it, a window will pop up that will be blank. Now add the following commands and save it.
Code:
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", MODE="0666"
Now save this File And follow the given codes
After you've entered those codes type these codes in too.
Code:
sudo service udev restart
sudo adb kill-server
sudo adb start-server
After you've entered those codes, restart Ubuntu.
Now to see if the problem is solved type these codes in:
Code:
cd ~/sdk/platform-tools ./adb devices
If everything is ok a output similar to this will be shown:
List of devices attached 0123456789ABCDEF device
Now to add the ADB path to system, so you don't have to cd to the SDK folder every time you want to use ADB:
So, first open up .bashrc with these codes:
Code:
sudo gedit ~/.bashrc
A window will pop up and there will be some text there. Scroll down to the bottom and add these lines:
Code:
export PATH=${PATH}:~/sdk/tools
export PATH=${PATH}:~/sdk/platform-tools
After you've done that, save it and reboot Ubuntu.
If everything is ok, you will get some output when you type the following codes in the terminal.
Code:
./adb devices
OR
Code:
adb shell
If you see:
Code:
adb not found[CODE]
Then it means you've done something wrong and ADB is not configured.
Next is GIT:
Open the browser and download git from given link
[URL]http://git-core.googlecode.com/files/git-1.7.9.6.tar.gz[/URL]
Extract GIT-1.7.9.6.tar.gz to your home directory
Rename the folder you extracted to from GIT-1.7.9.6.tar.gz to git
After you've done that, enter the following codes in the Terminal
[CODE]sudo aptitude build-dep git-core
sudo apt-get install zlib1g-dev
cd git
./configure
make
sudo make install
NOTE: If it doesn't work then install from this link:
http://kibyegon.wordpress.com/2010/0...u-lucid-10-04/
If the commands from above are not working then try this:
Code:
sudo apt-get install git-core
sudo apt-get install git
git
If it worked it should show this:
Code:
usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]
[-p|--paginate|--no-pager] [--no-replace-objects]
[--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE]
[--help] COMMAND [ARGS]
The most commonly used git commands are:
add Add file contents to the index
bisect Find by binary search the change that introduced a bug
branch List, create, or delete branches
checkout Checkout a branch or paths to the working tree
clone Clone a repository into a new directory
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
fetch Download objects and refs from another repository
grep Print lines matching a pattern
init Create an empty git repository or reinitialize an existing one
log Show commit logs
merge Join two or more development histories together
mv Move or rename a file, a directory, or a symlink
pull Fetch from and merge with another repository or a local branch
push Update remote refs along with associated objects
rebase Forward-port local commits to the updated upstream head
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index
show Show various types of objects
status Show the working tree status
tag Create, list, delete or verify a tag object signed with GPG
See 'git help COMMAND' for more information on a specific command.
Now we will download the Repo and get the source code:
Codes to type in the Terminal :
Code:
mkdir ~/bin
PATH=~/bin:$PATH
sudo apt-get install curl
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
mkdir source
cd source
Ok so up to this part its mostly universal. However after this you need to sync up sources for your device. This will probably take a long time depending on your internet speed since the source is very big (also it will take up a lot of drive space: 14-30GB). After that you should build.
How to build
First you will need to get proprietary drivers from your device.
Connect your device via USB and enter the following commands (from the root of your source repository):
Code:
cd device/xxx/xxx where x is the path to your device
./extract-files.sh
cd ../../..
NOTE: Some developers can include these files in the source itself or can make them available for download from their Github page. Check that out with your developer for more info.
And start the build:
Code:
. build/envsetup.sh xxx
NOTE:Here x also varies since its unique for every device model
Now Android is building. You may need to wait a long time (depending on your hardware-mainly CPU and RAM for example I have a quad core 2.92Ghz CPU and 6GB of HyperX DDR3 ram and it took me about 10min for CM7 and about 20-30 min for CM9).Once it's done you should get this message:
Code:
Package complete:xxx.zip
That is your flashable .zip file you install from recovery.
Credits: Many thanks go to Keyur Maru who helped me learn how to develop and for making the base of this guide.
Reference: http://source.android.com/source/downloading.html
Very good tutorial for beginner
sangosnip69 said:
Very good tutorial for beginner
Click to expand...
Click to collapse
Thanks we tried our best since this is supposed to boost our dev base for our LG
Definitely one to try at home!
Sent from my GT-I9100 using xda premium
Wow 10min is real fast!! I recently tried CM9 directly from one of the Dev's forked repo and after about 4hours of build I got some build error! I need to get a better computer soon if I plan to get my hands real dirty! And if I may I have few suggestions - please mention that it will take a while to download the full repo from google sources else beginners may end up thinking something is wrong(which I did since it took me one full day to sync everything) and that it needs atleast 20-30GB disk space too..(Coz not everyone has Ubuntu as the only OS, I have three in my lapi!!)
A very good guide on the whole for a beginner!!!
pranks1989 said:
Wow 10min is real fast!! I recently tried CM9 directly from one of the Dev's forked repo and after about 4hours of build I got some build error! I need to get a better computer soon if I plan to get my hands real dirty! And if I may I have few suggestions - please mention that it will take a while to download the full repo from google sources else beginners may end up thinking something is wrong(which I did since it took me one full day to sync everything) and that it needs atleast 20-30GB disk space too..(Coz not everyone has Ubuntu as the only OS, I have three in my lapi!!)
A very good guide on the whole for a beginner!!!
Click to expand...
Click to collapse
Very true a great in depth and very informative tutorial for noobs like i was this would have helped me a lot.... Great work
btw pranks1989 i can help you with compiling for defy.... I used to compile roms from eppy's and quarx2k github and never got a error once it else onece eppy pinted out the mistake i was doing.... just send me a pm of your errors and i will try help
Great start for me!
You have been thanked!
Great start for me!
What would the procedure be if you want to create a rom that you can flash via Odin or Heimdall on a Mac client?
The guide I've been looking for ever since I had my first Android device (actually, my Optimus Me is my first Android device)...
Thanks for this great guide. I will try it today.
I already compiled a Rom, it took me 40 min. AMD 8 Core 3,1 MHz and 16 GB DDR3
But when i try a different device i always get errors, i hope your Guide will get me in to it.
serendipityguy said:
You have been thanked!
Great start for me!
What would the procedure be if you want to create a rom that you can flash via Odin or Heimdall on a Mac client?
Click to expand...
Click to collapse
I don't know but it's surely different for odin(I'm not sure that you can).And I don't know on mac either since I use ubuntu and windows. You can look up info on this on the official Android dev website.
Sent from my Optimus Me using xda premium
nerot said:
I don't know but it's surely different for odin(I'm not sure that you can).And I don't know on mac either since I use ubuntu and windows. You can look up info on this on the official Android dev website.
Sent from my Optimus Me using xda premium
Click to expand...
Click to collapse
Odlicno objasnjeno za pocetnike. Svaka cast
Good Beginners Guide. Thank you.
But 90% of it can also be found here:
http://source.android.com/source/initializing.html
This is what i used to build android for the pandaboard a few weeks ago.
And then I have a few questions.
1.
Why do you compile git when you can also download it from apt-sources? Imho this is just confusing for beginners.
2.
Where do you use git in your tutorial?
3.
Didn't you forget lunch and make at the very end of your tutorial?
". build/envsetup.sh" only sets up the environment, imho
(see also here: http://source.android.com/source/building.html)
nerot said:
First you will need to get proprietary drivers from your device.
Connect your device via USB and enter the following commands (from the root of your source repository):
Code:
cd device/xxx/xxx where x is the path to your device
./extract-files.sh
cd ../../..
Click to expand...
Click to collapse
How do I find out what the path is from my device?
I would add the option to install Ubuntu in a VM. Both VMWare player and VirtualBox are free and well supported. This way one can actually create some pre-packaged images with which one can start development right away. In fact I've already made two of them a year ago (one for Froyo and one for Gingerbread):
http://forum.xda-developers.com/showthread.php?t=881845
http://forum.xda-developers.com/showthread.php?t=1022407
One might also make on for ICS (for that Ubuntu 12.04 is also good, and since VMWare Player is free one could use that instead of VirtualBox, as VMWP has more user-friendly features)
If I had a nickle for every time I've seen a thread like this, I would have... a nickle.
Thank you from the bottom of my /dev/hda1
sztupy said:
I would add the option to install Ubuntu in a VM. Both VMWare player and VirtualBox are free and well supported. This way one can actually create some pre-packaged images with which one can start development right away. In fact I've already made two of them a year ago (one for Froyo and one for Gingerbread):
http://forum.xda-developers.com/showthread.php?t=881845
http://forum.xda-developers.com/showthread.php?t=1022407
One might also make on for ICS (for that Ubuntu 12.04 is also good, and since VMWare Player is free one could use that instead of VirtualBox, as VMWP has more user-friendly features)
Click to expand...
Click to collapse
True however unless you have a LOT of ram and a hexa-core CPU compilation under a vm is significantly slower and that's why I didn't add it.But the procedure is the same anyway.
Sent from my Optimus Me using xda premium
Gigadroid said:
How do I find out what the path is from my device?
Click to expand...
Click to collapse
Google is your friend
Sent from my Optimus Me using xda premium
TheBadFish said:
Good Beginners Guide. Thank you.
But 90% of it can also be found here:
http://source.android.com/source/initializing.html
This is what i used to build android for the pandaboard a few weeks ago.
And then I have a few questions.
1.
Why do you compile git when you can also download it from apt-sources? Imho this is just confusing for beginners.
2.
Where do you use git in your tutorial?
3.
Didn't you forget lunch and make at the very end of your tutorial?
". build/envsetup.sh" only sets up the environment, imho
(see also here: http://source.android.com/source/building.html)
Click to expand...
Click to collapse
1.Idk I found this thing simple as well
2.I will review it later since I'm on my phone now and its 00:13 here
3.I don't think it's necessary since I use the same procedure for my rom compilation. I will add it tough just in case someone gets an error.Thanks for the tip.
Sent from my Optimus Me using xda premium
I'll try this on my six core seeing as it would make a perfect devving machine.
just following
Just posting here to follow. I will have to try this tonight. This looks awesome!
First off this guide is only for developers. If you are not a developer or using this to develop something that has to do with android development please don't clutter up the thread with useless post and/or questions not related to this guide.
This guide will cover the basics on how to install Sun Java Oracle jdk (aka Java Development Kit) on Ubuntu 12.04+. Ubuntu has removed this from their apt repositories since 12.04, so this has made it a little difficult for android developers to install and use when building source ROMs. You can use open jdk, but I and other developers prefer to use Sun Java Oracle jdk. Note that android platforms 2.3 gingerbread and above all require Java 1.6. Froyo requires java 1.5 so this guide will not be useful for that. Some ROM sources such as Linaro and SaberMod can build with java 1.7
If you want to install java 1.7.0 jdk skip straight to THIS Guide
Prerequisites
Ubuntu 12.04 or later
Some basic knowledge of Ubuntu/Linux
Knowledge on how to develop for android (this guide will not cover that)
Instructions
1) Download Java
Download the latest 1.6 version of java for Linux from Sun Java Oracle's website. Make sure you have the correct version for your system. 64-bit users download the x64 ones.
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Select the latest "Java SE 6 Update" download (currently 38)
2) Install Java
Open a command terminal and enter these commands, pressing enter after each line.
Note the versions will change when a new version is updated, change command lines accordingly.
Code:
cd ~/Downloads
chmod +x ~/Downloads/jdk-6u38-linux-x64.bin
~/Downloads/./jdk-6u38-linux-x64.bin
sudo mkdir -p /usr/lib/jvm/jdk1.6.0
sudo mv ~/Downloads/jdk1.6.0_38/* -f /usr/lib/jvm/jdk1.6.0/
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0/bin/javaws" 1
3) Config java to be default
This next part will allow you to make sun java default after installing it.
Code:
sudo update-alternatives --config java
This will bring up a GUI in terminal to select which java you want to make default with numbers listed for each one. 0 being default, 1 is normally the same java version as 0. Select the sun java one usually 2. Type the number and press enter. Next do the same for javac and javaws.
Code:
sudo update-alternatives --config javac
Code:
sudo update-alternatives --config javaws
Add java to your .bashrc
Code:
gedit ~/.bashrc
Add this to the very bottom of the file
Code:
# Java
export PATH=$PATH:/usr/lib/jvm/jdk1.6.0/bin
You must open a new terminal window/tab each time you edit your .bashrc file
Updating newer java versions. Just repeat steps 1, 2 and 3 but exclude this command and .bashrc edits.
Code:
sudo mkdir -p /usr/lib/jvm/jdk1.6.0
Make sure to run this commands first before anything else
Code:
sudo rm -rf /usr/lib/jvm/jdk1.6.0/*
Thanks for the tip
When building CM10, we get a warning if version is not exactly the java 1.6 expected. Any issue with that when building CM10?
No no warnings. I had some warnings before with open jdk tho building cm10.
Sent from my Nexus 7 using Tapatalk 2
I see
What is the version of JDK officially recommended by CM team ? Sun Java Oracle jdk or the open jdk?
Phil3759 said:
I see
What is the version of JDK officially recommended by CM team ? Sun Java Oracle jdk or the open jdk?
Click to expand...
Click to collapse
It's all about your own preference. I'm not sure what the cm team uses for their build machines or each individual member uses... I prefer Oracle just because it's updated more with bug and security fixes :thumbup:
Sent from my Nexus 7 using Tapatalk 2
Just a small question. I've has Sun Java installed for a while now. I've been building CyanogenMod, and plain AOSP just fine the whole time too. I've noticed that a couple guides, including yours, suggest adding lines to the bash.rc for this. I never did that for Java, and everything has been great. Why is this; and is it going to come back and bite me eventually?
Thanks.
I couldn't build without errors on 12.10 without the .bashrc edits. I did an fresh install of 12.10 instead of upgrading maybe that's why but idk for sure. It just makes sure that that version of java always gets used no matter what. You can always gedit .bashrc again to edit it and remove or add things so no it won't be problematic. You can also verify your using sun java and not open java by typing java -version on terminal. It should read Java(TM) SE Runtime Environment.
Sent from my Nexus 7 using Tapatalk 2
Phil3759 said:
Thanks for the tip
When building CM10, we get a warning if version is not exactly the java 1.6 expected. Any issue with that when building CM10?
Click to expand...
Click to collapse
For what it's worth, Sun Java has always given warnings such about things being deprecated in future releases, and every build has always been fine. I'm not saying there aren't any potential problems, however, from everything I've seen, there have been no problems yet.
Great Step By Step Guide For All New User...........:good::good:
Updated OP with instructions on how to make sun java default.
Code:
sudo update-alternatives --config java
Sent from my Nexus 7 using Tapatalk 2
Ive got this error:
sudo mv ~/Descargas/jdk1.6.0_37/* -f /usr/lib/jvm/jdk1.6.0/
mv: no se puede efectuar `stat' sobre «/home/adrian/Descargas/jdk1.6.0_37/*»: No existe el archivo o el directorio
adri_360 said:
Ive got this error:
sudo mv ~/Descargas/jdk1.6.0_37/* -f /usr/lib/jvm/jdk1.6.0/
mv: no se puede efectuar `stat' sobre «/home/adrian/Descargas/jdk1.6.0_37/*»: No existe el archivo o el directorio
Click to expand...
Click to collapse
I can't read Spanish but it looks like you didn't create the directory yet.
Sent from my Nexus 7 using Tapatalk 2
The error he got is that the jdk1.6.0_37 folder gets created in the home folder, but the command looks for it in the Downloads folder. Just move the folder manually to the Downloads folder.
@Sparksco wasn't there a couple of lines we needed to add to the .bashrc file in the beginning to finish this change? I had to set up my build enviroment again, but after doing this I keep getting the error about using the wrong java version.
---------- Post added at 07:03 AM ---------- Previous post was at 06:37 AM ----------
sparksco said:
I couldn't build without errors on 12.10 without the .bashrc edits. I did an fresh install of 12.10 instead of upgrading maybe that's why but idk for sure. It just makes sure that that version of java always gets used no matter what. You can always gedit .bashrc again to edit it and remove or add things so no it won't be problematic. You can also verify your using sun java and not open java by typing java -version on terminal. It should read Java(TM) SE Runtime Environment.
Sent from my Nexus 7 using Tapatalk 2
Click to expand...
Click to collapse
Could you share with me the edits? This is what I was reffering to on my last comment.
apascual89 said:
The error he got is that the jdk1.6.0_37 folder gets created in the home folder, but the command looks for it in the Downloads folder. Just move the folder manually to the Downloads folder.
@Sparksco wasn't there a couple of lines we needed to add to the .bashrc file in the beginning to finish this change? I had to set up my build enviroment again, but after doing this I keep getting the error about using the wrong java version.
---------- Post added at 07:03 AM ---------- Previous post was at 06:37 AM ----------
Could you share with me the edits? This is what I was reffering to on my last comment.
Click to expand...
Click to collapse
Did you run sudo update-alternatives --config java ?
I don't think you need to add .bashrc edits if you configure java, javac and javaws to be with sun java oracle. Let me know how it goes I can add the .bashrc edits back if needed.
Code:
sudo update-alternatives --config javac
Code:
sudo update-alternatives --config javaws
Where these two there this morning? Am I losing my mind? I'll check and let you know.
apascual89 said:
Code:
sudo update-alternatives --config javac
Code:
sudo update-alternatives --config javaws
Where these two there this morning? Am I losing my mind? I'll check and let you know.
Click to expand...
Click to collapse
Those two I added just in case... The java one was already there lol.
Sent from my Nexus 7 using Tapatalk 2
sparksco said:
Those two I added just in case... The java one was already there lol.
Sent from my Nexus 7 using Tapatalk 2
Click to expand...
Click to collapse
Yep that did it! It's building. Thanks Again
Java update
Oracle released u38 version which has security and bug fixes in it. More info here on bug fixes: http://www.oracle.com/technetwork/java/javase/2col/6u38-bugfixes-1880999.html As you can see there are quite a few
Also I updated the OP for version 38 and instructions on how to update to a newer version.
If your building ROMs you'll want to do a completely new clean build. For example remove your entire out directory before building.
[GUIDE][DEV] How to install Sun Java Oracle 1.7.0 jdk on Ubuntu 12.04+
In this guide you will be installing java 1.7
Prerequisites
Ubuntu 12.04 or later
Some basic knowledge of Ubuntu/Linux
Knowledge on how to develop for android (this guide will not cover that)
Instructions
1) Download Java 1.7
Download the latest 1.7 version of java for Linux from Sun Java Oracle's website. Make sure you have the correct version for your system. 64-bit users download the x64 ones.
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Select the latest "Java SE 7 Update" download (current 10)
2) Install Java
Open a command terminal and enter these commands, pressing enter after each line.
Note the versions will change when a new version is updated, change command lines accordingly.
First check for previous installations of openjdk for java 6 and 7
Code:
sudo apt-get remove openjdk-6-jdk
sudo apt-get remove openjdk-7-jdk
# For this next part remove anything that is openjdk with sudo rm -rf
Code:
ls /usr/lib/jvm
sudo rm -rf /usr/lib/jvm/###VersionYouWantToRemove###
Note: If you see
Code:
/usr/lib/jvm/default-java
You need to remove it. If you don't see it ignore this next command.
Code:
sudo rm /usr/lib/jvm/default-java
Continue.
Code:
cd ~/Downloads
gunzip ~/Downloads/jdk-7u10-linux-x64.tar.gz
tar -xvf ~/Downloads/jdk-7u10-linux-x64.tar
sudo mkdir -p /usr/lib/jvm/jdk1.7.0
sudo mv ~/Downloads/jdk1.7.0_10/* -f /usr/lib/jvm/jdk1.7.0/
For this part do not skip any steps
Code:
sudo ln -s /usr/lib/jvm/jdk1.7.0 /usr/lib/jvm/default-java
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1
3) Config java to be default
This next part will allow you to make sun java default after installing it. This will bring up a GUI in terminal to select which java you want to make default with numbers listed for each one. 0 being default, 1 is normally the same java version as 0. Select the sun java 1.7.0 one. Type the number and press enter.
Code:
sudo update-alternatives --config java
Code:
sudo update-alternatives --config javac
Code:
sudo update-alternatives --config javaws
Add java to your .bashrc
Code:
gedit ~/.bashrc
Add this to the very bottom of the file
If you have java 1.6 in your PATH you'll need to remove it in order to use java 1.7
Code:
# Java
export PATH=$PATH:/usr/lib/jvm/jdk1.7.0/bin
You must open a new terminal window/tab each time you edit your .bashrc file
Updating newer java versions. Just repeat steps 1, 2 and 3 but exclude these commands and .bashrc edits.
Code:
sudo mkdir -p /usr/lib/jvm/jdk1.7.0
sudo ln -s /usr/lib/jvm/jdk1.7.0 /usr/lib/jvm/default-java
Make sure to run these commands first before anything else
Code:
sudo rm -rf /usr/lib/jvm/jdk1.7.0/*
OP Update with new Guide instructions for java 1.7
I have yet to see a good, COMPLETE, step by step tutorial for building firefoxOS, so since I figured it out thought I would document the steps I took and get a good guide going for us.
**This guide is written with Samsung Nexus S 4G (crespo4G) specifically in mind, but it can easily be adapted to any officially supported device
what you will need:
a nexus s 4g (or other officially supported device)
a pc capable of compiling android from source (ie: minimum 2x core cpu, 4gb ram)
ubuntu 12.10 or 13.04 64-bit (google it, it's open source!)
broadband internet (trust me, you want a minimum of 10mbit/sec)
a basic understanding of terminal command, adb and fastboot
ok, let's get started!!
I'll assume you've already installed ubuntu and gotten the network set up. If not, do so now.
First, set up the build environment....
Install java:
Code:
$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
Code:
$ sudo apt-get update
Code:
$ sudo apt-get install sun-java6-jdk
If you have multiple java installations you need to change the version your system is using
Code:
$ wget http://webupd8.googlecode.com/files/update-java-0.5b
Code:
$ chmod +x update-java-0.5b
Code:
$ sudo ./update-java-0.5b
(it says java 0.5, but it's java 6 don't worry)
choose any java 6 installation and save.
Install android sdk:
download the sdk from android dev site
http://developer.android.com/sdk/index.html
extract it to ~/android/sdk/.....
Code:
$ cd ~/android/sdk/tools
Code:
$ ./android update sdk
update all packages
Install adb & fastboot:
Code:
$ sudo add-apt-repository ppa:nilarimogard/webupd8
Code:
$ sudo apt-get update
Code:
$ sudo apt-get install android-tools-adb android-tools-fastboot
test it!!!
Code:
$ adb devices
Install dependancies:
ubuntu 12.10+ dependancies
Code:
$ sudo apt-get install autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib gcc-4.6 g++-4.6 g++-4.6-multilib git ia32-libs lib32ncurses5-dev lib32z1-dev libgl1-mesa-dev libx11-dev make
64 bit dependancies
Code:
$ sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so
Code:
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Clone the repo:
Code:
$ git clone git://github.com/mozilla-b2g/B2G.git
Code:
$ cd ~/B2G
Download the source:
Plug in your device, ensure ICS or newer is installed, then enable usb debugging
Code:
$ ./config.sh nexus-s-4g
This is where you can change the guide to work with any supported device. The proper syntax is as follows
Code:
$ ./config.sh (device name)
where (device name) is one of the following:
- galaxy-s2
- galaxy-nexus
- nexus-s
- nexus-s-4g
- otoro
- unagi
- pandaboard
- emulator
- emulator-x86
This takes about an hour
When the source is done downloading, create a file called .userconfig with gedit containing the following two lines of code then save and drop it in ~/B2G
export CC=gcc-4.6
export CXX=g++-4.6
Building from source:
if you're not already there
Code:
$ cd ~/B2G
Code:
$ ./build.sh
*if you get build errors, use a -j option. -j1 option tells your pc to use only one cpu core. -j2 tells it to use 2, and so on...
Using less cpu cores can lead to a more stable build environment and reduce errors
If you use a -j1 option, the syntax is as follows:
Code:
$ ./build.sh -j1
This takes HOURS (probably 4-5)
Flashing b2g:
when it's done, find the .img files in ~/B2G/out/product/target/crespo4g
Code:
$ cd ~/B2G/out/product/target/crespo4g
Boot your device to the bootloader
Code:
$ sudo fastboot flash boot boot.img
Code:
$ sudo fastboot flash system system.img
Code:
$ sudo fastboot flash userdata userdata.img
To create a flashable zip:
plug in your device and enable usb debugging
Code:
$ sudo adb pull /system ~/Documents/crespo4g/b2g
Code:
$ sudo adb pull /data ~/Documents/crespo4g/b2g
add the meta-inf from another nexus s 4g flashable zip
create a .zip with the 3 directories (meta-inf, system and data) and the boot.img you just created
flash in recovery after a FULL wipe (system, boot, data, cache, dalvik)
reserved
Reserved again
Thanks ! Will try this !
Sent from my Nexus s using xda app-developers app
Big Thx Good Guide