It appears sun-java6-jdk has been removed from the Canonical repository. I added "http://archive.canonical.com/ lucid partner" to my sources, but the package is not there. Are there any alternative ways to install it?
There are quite plenty of ways actually:
1. Install from some ppa:
Code:
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jdk sun-java6-plugin
2. Download bin package from oracle site, but that's not ubuntu-way.
3. This one i like the most: create your own packages
http://www.techytalk.info/latest-oracle-sun-java-jdk-and-jre-6-on-ubuntu-operating-systems/
and in any case, don't forget to
Code:
sudo update-alternatives --config java
inflim said:
There are quite plenty of ways actually:
1. Install from some ppa:
Code:
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jdk sun-java6-plugin
2. Download bin package from oracle site, but that's not ubuntu-way.
3. This one i like the most: create your own packages
http://www.techytalk.info/latest-oracle-sun-java-jdk-and-jre-6-on-ubuntu-operating-systems/
and in any case, don't forget to
Code:
sudo update-alternatives --config java
Click to expand...
Click to collapse
It worked, Thank You!
No problem! Google rules
I learned about this here... http://fieldeffect.info/w/NativeCompileSDK
You can install an i386/x86_64 chroot within your existing Debian chroot using qemu-user-static to run the Android SDK on your Android phone/tablet/phablet.
1.
Get yourself a debian chroot, I recommend at least 2gb. I use DebianKit from market.
2.
You will need a X11 desktop environment and a VNC client on your device. I use androidVNC from market.
Here is my working example...
Start your Debian chroot/environment and do...
apt-get install openbox openbox-themes obmenu obconf menu menu-xdg xdg-utils xfonts-base xfonts-terminus* nautilus terminator lxappearance gmrun leafpad man-db hicolor-icon-theme tightvncserver tint2
That gives you a window manager, fonts, filebrowser, terminal emulator, text editor, theme manager, taskbar, and a VNC server.
Now lets get some GTK engines and libraries....
apt-get install gtk2-engines-auroa gtk2-engines-murrine gtk2-engines-oxygen gtk2-engines-pixbuf libgtk2.0-bin gtk3-engines-oxygen gtk3-engines-unico libgtk-3-bin
Now 7zip to handle zips and archives comfortably(put non-free in your apt sources.list)...
apt-get install p7zip p7zip-full p7zip-rar zip unzip
##The Android SDK manager, qemu, and multistrap##
apt-get install ant file openjdk-6-jre openjdk-6-jdk qemu-user-static libswt-gtk-3-java libswt-cairo-gtk-3-jni
3.
Now we can build a small x86_64 rootfs using multistrap
multistrap can use a config, have mine...
http://db.tt/hS5j3wg
Copy multistrap.conf straight into your working(pwd) directory....
cp /sdcard/Download/multistrap.conf .
Do this to avoid multistrap complaining later...
cat multistrap.conf >mstrap
mkdir /data/mnt
Determine size of rootfs for loop image..
du -hs /data/mnt/
Now make an image for x86_64 chroot
dd if=/dev/zero of=/sdcard/64bit.img bs=$(( 0x100000 )) count=YOUR IMAGE SIZE
That byte size makes your image slightly larger than the count value in Mb, for example count=78 will write 82Mb image.
mkfs.ext2 /sdcard/64bit.img
tune2fs -c0 /sdcard/64bit.img
mkdir /data/tmp
busybox mount -o loop /sdcard/64bit.img /data/tmp/
cp -r /data/mnt/* /data/tmp/
umount /data/tmp
rm -r /data/tmp/
rm -r /data/mnt/
mkdir /data/mnt
busybox mount -o loop /sdcard/64bit.img /data/mnt/
5.
Now the environment is set up and mounted, at this point install the SDK
Aim your browser to http://developer.android.com/sdk/index.html
Select "Linux" from "SDK Tools Only", thats the last thing at the bottom of the list.
cp /sdcard/Download/android-sdk_r21.0.1-linux.tgz .
7z x android-sdk_r21.0.1-linux.tgz russosv
7z x android-sdk_r21.0.1-linux.tar
Now we need a couple goodies from http://fieldeffect.info/w/NativeCompileAPK ##--Thanks to russosv from FeildEffect
These are edited from original....
#!/bin/bash
QEMU=/usr/bin/qemu-x86_64-static
64CHROOT=/data/mnt/
case "$1" in
mklinks)
if [ ! -e "./64BIT" ]; then
mkdir ./64BIT
fi
for i in $(file ./* | grep "ELF 32" | awk '{print $1}' | sed s/://g | sed s/[./]//g); do
echo "Moving $i..."
mv $i ./64BIT
ln -s ~/bin/run-64-link $i
done-
;;
*)
$QEMU $64CHROOT/lib64/ld-linux-x86_64.so.2 --library-path $64CHROOT/lib:$64CHROOT/usr/lib:$64CHROOT/usr/share/perl/5.12.4/unicore/lib:$64CHROOT/var/lib:$64CHROOT/lib/x86_64-linux-gnu:$64CHROOT/usr/lib/x86_64-linux-gnu [email protected]
;;
esac
Copy that to run-64, then...
chmod 755 run64
cp run-64 /usr/bin/
One more...
echo $(dirname $0)/64BIT/$(basename $0) [email protected]
/usr/bin/run-i386 $(dirname $0)/64BIT/$(basename $0) [email protected]
Make that run-64-link
chmod 755 run-64-link
cp run-64-link /usr/bin/
5b.
Now launch VNC server
tightvncpasswd
tightvncserver
killall Xtightvnc
cat >.vnc/xstartup<<EOF
tint2 &
terminator &
openbox-session
EOF
tightvncserver
export DISPLAY=:1
6.
Now launch the VNC client I mentioned earlier, should connect with 127.0.0.1:5901 and your password you set.
Go back to terminal or use the one launched on X11 to do...
sh android-sdk-linux/tools/android
Install at least one api.
If all went well you can now go around "debugging" yours and your friends Android devices over wifi now.
For an example, and to see it work do....
svc wifi disable(or enable) ##this turns off/on wifi
setprop service.adb.tcp.port 5555(or -1) ##this turns on/off adb over network
stop adbd
start adbd
adb connect 127.0.0.1(yours) or any other adbd addy listening on your network,
Have fun
Never did a "how to" before, go easy and I'll make corrections and answer things. Thanks for reading. Leave feedback.
Potential necro post but I believe the information is still currently valid and not readily available on searches. I've looked variations of this up for years with no luck until I hit the right search terms.
bump, and thanks.
can't believe there's no comments.
I know it's a slower than real-64-bit-pc method but not all of us have access to new hardware... or pc's. Maybe a novelty, still cool and useful if you've got the time to let the slower hardware compile.
you have preserved the scripts, original link is dead.
here is the Internet Wayback Machine cache of the original circa 2012 for reference.
http://web.archive.org/web/20120502044700/http://fieldeffect.info/w/NativeCompileAPK
appreciate you sharing.
In the last few days I started to try the Ubuntu 14.04 daily builds on my computer and I tried to configure it to compile android roms and managed to get a working configuration :laugh:
This guide is meant for Ubuntu 14.04 Trusty Tahr 64 bit. 32 Bit won't work.
If you want to use another ubuntu version, some things might be a little different. Just search on xda and you will find all the instructions that you need to complete the setup.
DISCLAMER
Although the procedures in this guide were tested on my pc/phone and produced a working build for my Galaxy Nexus, I take no responsibility for any consequences derived from their use.
1) SET UP THE BUILD ENVIRONMENT
Remove openJDK and install Java 6 jdk. Open a terminal and type:
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
This will uninstall openJDK.
Code:
sudo add-apt-repository ppa:webupd8team/java
Adds a PPA to your system, needed to download java.
Code:
sudo apt-get update && sudo apt-get install oracle-java6-installer
Download and installs java!
To make sure the correct version of Java is activated, run the following at the Terminal prompt:
Code:
java -version
You should see something like that:
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
Now type:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python lzop
This will install the needed packages.
When done, do this:
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Now, install the repo binary:
Code:
mkdir ~/bin && curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo && chmod a+x ~/bin/repo
Edit .bashrc:
Code:
sudo nano ~/.bashrc
At the bottom of the file, add the following line:
Code:
export PATH=~/bin:$PATH
Save it (In nano type Ctrl-O and then Enter, then Ctrl-X to exit back to a prompt).
Restart bash:
Code:
source ~/.bashrc
Now you can download the sources of the rom that you want to compile, I make an examble for cm10.2:
2) DOWNLOAD THE SOURCES:
Code:
mkdir ~/cyanogenmod
cd ~/cyanogenmod
This creates a folder named "cyanogenmod" and opens it.
Initialize the repo:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.2
Download time!
Code:
repo sync
It will download about 10gb of data, so be patient!
Then get your device files and binaries and compile!
For a guide on how compile a ROM from source, just search on xda or look in my signature, there's also a guide for compiling roms.
Reserved
Updated the op with instructions for beta release
elia222 said:
Updated the op with instructions for beta release
Click to expand...
Click to collapse
I just installed Ubuntu 13.10 (fresh install in seprate HDD ) and i got error in step 1
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
ShoaibAhmed said:
I just installed Ubuntu 13.10 (fresh install in seprate HDD ) and i got error in step 1
Click to expand...
Click to collapse
This: http://askubuntu.com/questions/15433/how-do-i-fix-a-could-not-get-lock-var-lib-dpkg-lock-problem may help you.
Updated the op with instructions for 14.04 daily releases
This is crazy, I didnt even know ubuntu 14.04 was out till now, it just released a couple days ago! Great work dude:good:
noob
shoot me if i ask stupid questions but im new to this:
i wanna start with building a cm KOT49E rom for maguro: where do i get the files i need? like ´device tree' and things like that,i know there on github but then what? how do you ´ćherry pick' things?
firebird11 said:
shoot me if i ask stupid questions but im new to this:
i wanna start with building a cm KOT49E rom for maguro: where do i get the files i need? like ´device tree' and things like that,i know there on github but then what? how do you ´ćherry pick' things?
Click to expand...
Click to collapse
You can get device and kernel tree from cyanogenmod github (android_device_samsung_tuna, android_device_samsung_maguro, kernel_Samsung_tuna).
There's a good guide on xda called "how to use github" that explains cherry-picking and some other useful stuff.
error
self._write_file(output_dir, generator(), file_name)
gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
File "scripts/make_css_value_keywords.py", line 172, in generate_implementation
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
raise child_exception
errread, errwrite)
OSError: [Errno 2] No such file or directory
File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
make: *** [/home/firebird11/android/system/out/target/product/maguro/obj/GYP/shared_intermediates/blink/CSSPropertyNames.cpp] Error 1
make: *** Waiting for unfinished jobs....
make: *** [/home/firebird11/android/system/out/target/product/maguro/obj/GYP/shared_intermediates/blink/CSSValueKeywords.cpp] Error 1
[email protected]:~/android/system$
Click to expand...
Click to collapse
iḿ getting this error all the time and looked for it on google but canẗ find the right answer,, do you know what is wrong here?
ok, error solved, got something to do with sdk,
1 question: how do i merge a fork ,letś say "halo" in my build?
i downloaded it but dont know what to do? can i just simply put it in the build directory?
I am having trouble setting up JDK 6 via the method in the OP. Did it setup just fine for everyone else? I could use a little help setting up JDK 6 please.
elia222 said:
In the last few days I started to try the Ubuntu 14.04 daily builds on my computer and I tried to configure it to compile android roms and managed to get a working configuration :laugh:
This guide is meant for Ubuntu 14.04 Trusty Tahr 64 bit. 32 Bit won't work.
If you want to use another ubuntu version, some things might be a little different. Just search on xda and you will find all the instructions that you need to complete the setup.
DISCLAMER
Although the procedures in this guide were tested on my pc/phone and produced a working build for my Galaxy Nexus, I take no responsibility for any consequences derived from their use.
1) SET UP THE BUILD ENVIRONMENT
Remove openJDK and install Java 6 jdk. Open a terminal and type:
Code:
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*
This will uninstall openJDK.
Code:
sudo add-apt-repository ppa:webupd8team/java
Adds a PPA to your system, needed to download java.
Code:
sudo apt-get update && sudo apt-get install oracle-java6-installer
Download and installs java!
To make sure the correct version of Java is activated, run the following at the Terminal prompt:
Code:
java -version
You should see something like that:
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
Now type:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python lzop
This will install the needed packages.
When done, do this:
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Now, install the repo binary:
Code:
mkdir ~/bin && curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo && chmod a+x ~/bin/repo
Edit .bashrc:
Code:
sudo nano ~/.bashrc
At the bottom of the file, add the following line:
Code:
export PATH=~/bin:$PATH
Save it (In nano type Ctrl-O and then Enter, then Ctrl-X to exit back to a prompt).
Restart bash:
Code:
source ~/.bashrc
Now you can download the sources of the rom that you want to compile, I make an examble for cm10.2:
2) DOWNLOAD THE SOURCES:
Code:
mkdir ~/cyanogenmod
cd ~/cyanogenmod
This creates a folder named "cyanogenmod" and opens it.
Initialize the repo:
Code:
repo init -u git://github.com/CyanogenMod/android.git -b cm-10.2
Download time!
Code:
repo sync
It will download about 10gb of data, so be patient!
Then get your device files and binaries and compile!
For a guide on how compile a ROM from source, just search on xda or look in my signature, there's also a guide for compiling roms.
Click to expand...
Click to collapse
E: Unable to locate package oracle-java6-installer
??? i added the ppa and updated
Edit: there is no java6 intsaller for trusty, only 7 and 8, you have to intsall it manually
Also then repo bin thing should be: mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
Aaahh said:
E: Unable to locate package oracle-java6-installer
??? i added the ppa and updated
Edit: there is no java6 intsaller for trusty, only 7 and 8, you have to intsall it manually
Also then repo bin thing should be: mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo
Click to expand...
Click to collapse
Yeah. This is not an accurate guide. I had trouble getting java 6 installed too. There is a link at the bottom of this post and it will show you how I did it. Had to install it manually. Everything else should work properly I think. Anyways, if you have any questions about setting it up, feel free to PM me.
install java - http://askubuntu.com/questions/67909/how-do-i-install-oracle-jdk-6
install gksu - http://askubuntu.com/questions/290810/how-to-add-gksudo-or-what-to-use-instead-in-ubuntu-13-04
That should get you going on the java part.
to get Java JDK 6 do following (for install to a system without graphical Interface and above workaround not work):
1. Download the jdk-6u38-linux-x64.bin from the Oracle/Sun Java Download Area
Code:
wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u38-b05/jdk-6u38-linux-x64.bin"
2. Make the bin file executable:
Code:
chmod +x jdk-6u38-linux-x64.bin
3. Extract the bin file:
Code:
./jdk-6u38-linux-x64.bin
4. Move the extracted folder to this this location:
Code:
sudo mv jdk1.6.0_38 /usr/lib/jvm/./jdk-6u38-linux-x64.bin
5. Install the new Java source in system:
Code:
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/java 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javaws 1
sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javadoc 1
sudo update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javah 1
sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javap 1
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/jar 1
6. Select the default Java version for your system:
Code:
sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo update-alternatives --config javaws
sudo update-alternatives --config javadoc
sudo update-alternatives --config javah
sudo update-alternatives --config javap
sudo update-alternatives --config jar
7. Check Java version:
Code:
java -version
8. Verify the symlinks. Javac, Java, Javaws, Javadoc, Javah, Javap and Jar should all point to the new Java location and version:
Code:
ls -la /etc/alternatives/java* && ls -la /etc/alternatives/jar
MetaIIica said:
to get Java JDK 6 do following (for install to a system without graphical Interface and above workaround not work):
1. Download the jdk-6u38-linux-x64.bin from the Oracle/Sun Java Download Area
Code:
wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/6u38-b05/jdk-6u38-linux-x64.bin"
2. Make the bin file executable:
Code:
chmod +x jdk-6u38-linux-x64.bin
3. Extract the bin file:
Code:
./jdk-6u38-linux-x64.bin
4. Move the extracted folder to this this location:
Code:
sudo mv jdk1.6.0_38 /usr/lib/jvm/./jdk-6u38-linux-x64.bin
5. Install the new Java source in system:
Code:
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javac 1
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/java 1
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javaws 1
sudo update-alternatives --install /usr/bin/javadoc javadoc /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javadoc 1
sudo update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javah 1
sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/javap 1
sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk-6u38-linux-x64.bin/bin/jar 1
6. Select the default Java version for your system:
Code:
sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo update-alternatives --config javaws
sudo update-alternatives --config javadoc
sudo update-alternatives --config javah
sudo update-alternatives --config javap
sudo update-alternatives --config jar
7. Check Java version:
Code:
java -version
8. Verify the symlinks. Javac, Java, Javaws, Javadoc, Javah, Javap and Jar should all point to the new Java location and version:
Code:
ls -la /etc/alternatives/java* && ls -la /etc/alternatives/jar
Click to expand...
Click to collapse
ALSO add to path and thats 38 not 45... doesn't really matter but still.
Its a sample and you can replace 6u38 with 6u45
work fine too
This work better, faster and install every time the last JDK 6
Needed if have apt-apt-repository Command not found
Code:
sudo apt-get install -y python-software-properties
Then
Code:
sudo add-apt-repository "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main"
sudo apt-get update
sudo apt-get install -y oracle-java6-installer
java -version
ls -la /etc/alternatives/java* && ls -la /etc/alternatives/jar
I was able to install oracle jdk 6 without any problem, using elia222's method
These instructions worked perfectly on 14.04 (update from 13.10 using update-manager -d)! :good: