I tried installing Android Studio on a Samsung Chromebook Series 3 with an ARM processor, but I'm stuck with the Java. Any help would be appreciated.
Downloaded and extracted Android Studio
Downloaded and extracted Java 1.7.0_21 JDK ARM
Completed the below commands except the javaws commands as they error-ed out doesn't exist
tar xzvf ~/Downloads/jdk-7u21-linux-arm.tar.gz sudo mv jdk1.7.0_21/ /usr/lib/jvm/
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_21/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_21/bin/javac 1 sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.7.0_21/bin/javaws 1
sudo update-alternatives --config java
sudo update-alternatives --config javaws
I tried the JAVA_HOME=/usr/lib/jvm/jdk1.7.0_21 command and it would still give me the error.
Please check whether your system configuration is 32bit or 64bit and according to that download respective JDK and provide its path in JAVA_HOME
No It's not in the studio. What you should do:
Change your JRE to use the JRE found inside your JDK
Add tools.jar that can be found in the JDK Libraries folder
That's it. It's a known issue, but they're working on it. But this is a workaround.
Couple of things, you can check:
1. check jdk is in your path
2. from your command line, execute this command: java -version
and see what it shows
3. and execute this command: javac -version
If both command gives no error then try again otherwise fix those issue.btw, Do not forget to check your system configuration to make sure that it is 32bit or 64 bit
Related
I got the following error while compiling android source code for the first time on Ubuntu 12.04, I have not chenged the source code at all abd suggested command in error "make update-api" didn't help me
repo sync
source build/envsetup.sh
lunch full-eng
make
http://pastebin.com/5gEjkTLV
As the problem is in the java part here is my java installation information. I downloaded jdk-6u39-linux-x64.bin and run it and copy the file into /usr/lib/jvm/jdk1.6.0_39/ and set the this java as the main java application by :
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_39/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_39/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_39/bin/javaws" 1
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
here is the result:
echo $JAVA-HOME
/usr/lib/jvm/jdk1.6.0_39/
java -version
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01, mixed mode)
javac
javac 1.6.0_39
Look at the dump again. you need to regenerate api/current.txt. You need to run make update-api to regenerate that file. You should be able to build again after that .
******************************
You have tried to change the API from what has been previously approved.
To make these errors go away, you have two choices:
1) You can add "#hide" javadoc comments to the methods, etc. listed in the
errors above.
2) You can update current.txt by executing the following command:
make update-api
To submit the revised current.txt to the main Android repository,
you will need approval.
******************************
I have installed Android Studio and I followed all steps described here
But when I start studio.sh I got an error with this message:
'tools.jar' is not in Android Studio classpath. Please ensure JAVA_HOME points to JDK rather than JRE
Can anyone here help me with this?
Check if your Java JDK is installed correctly
dpkg --list | grep -i jdk
If not, install JDK
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update && sudo apt-get install oracle-java8-installer
After the installation you have to enable the jdk
update-alternatives --display java
Check if Ubuntu uses Java JDK 8
java -version
If all went right the answer should be something like this:
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
Check what compiler is used
javac -version
It should show something like this
javac 1.8.0_91
Finally, add JAVA_HOME to the environment variable
Edit /etc/environment and add JAVA_HOME=/usr/lib/jvm/java-8-oracle to the end of the file
sudo nano /etc/environment
Append to the end of the file
JAVA_HOME=/usr/lib/jvm/java-8-oracle
You will then have to reboot, you can do this from the terminal with:
sudo reboot
In case you want to remove the JDK
sudo apt-get remove oracle-java8-installer
sudo apt-get install default-jdk
That's all in ubuntu 11
This is caused by having JAVA JRE installed as opposed to JAVA JDK.
The solution is simple:
sudo apt-get install openjdk-7-jdk
http://www.maxmakedesign.co.uk/development/2013/android-studio-tools-jar-classpath/
The error is self explanatory, you need to set your environment variable to JDK path instead of JRE here is it
JDK_HOME: C:\Program Files\Java\jdk1.7.0_07
check the path for linux
and here is possible duplicate Android Studio not working
Widows 7 64 bit.
JAVA_HOME point to my JRE (NOT JDK) directory
Coping of tools.jar from JDK\lib directory to ANDROIDSTUDIO\lib directory solve the problem
in OpenSuSE 13.1 and some 13.2 versions you also need to:
install java-1_7_0-openjdk-devel package
change the JAVA_HOME path when starting the studio:
For x86:
JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0/ sh studio.sh
For x64:
JAVA_HOME=/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0/ sh studio.sh
I had the same problem on a new installed Linux Mint 16. To fix this you just need to type command
sudo apt-get install openjdk-7-jdk
And that's it. You even do not need to add repositiries or creating JAVA_HOME in your environment.
On ubuntu I have tried all the methods that are described here but none worked.
What I did in the end was to:
download JDK from oracle, extract the archive
edit android-studio/bin/studio.sh and add at the top
export JAVA_HOME=/path/to/jdk
save the file and cd android-studio/bin and launch Android Studio: ./studio.sh
For me, running Fedora 22 with Gnome 16.2, this solution helped me.
In short, you should install the java-1.8.0-openjdk-devel, the development files of the JDK.
Open the Terminal and search for the latest version of the JDK development package:
$ dnf search jdk-devel
Last metadata expiration check performed 12:44:51 ago on Mon Aug 3 22:20:24 2015.
============================ N/S Matched: jdk-devel ============================
java-1.8.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.8.0-openjdk-devel-debug.x86_64 : OpenJDK Development Environment with
: full debug on
$ sudo dnf install java-1.8.0-openjdk-devel
First check if the Java JDK is installed correctly:
dpkg --list | grep -i jdk
If not, install the JDK:
Download the latest version of the JDK from Oracle: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Extract it to the appropriate location in your machine. Get the extract location:
vi ~/.bashrc or vi ~./ bash_profile
JAVA_HOME=/home/user/installs/jdk1.7.0_40
PATH=$JAVA_HOME/bin
source ~/.bashrc or source ~/.bash_profile
After the installation you can check it:
java -version
which java
If all things are correct then the right the answer should be something like this:
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)
Append the following statement to studio.sh the file in android-studio/bin directory:
JAVA_HOME=/home/user/installs/jdk1.7.0_40
Finally start your Android Studio with the following command:
./studio.sh
The problem is a bug on Fedora 20. The bug is very odd: if I have Google Talk plugin installed then Eclipse crashes (https://bugs.eclipse.org/bugs/show_bug.cgi?id=334466). It's crazy for me. I thought that was Java version and with Java 6 my eclipse was still crashing. To solve this I should use gnome/GTK instead KDE. Now it works "well" (in gnome environment). Thanks for all answers.
I was facing similar problem on Windows 7 x64 professional edition. Please note following steps to fix this problem.
tools.jar is missing from required path if you are using jdk1.7 x64 bit version.
Please install x86 version of jdk1.7
Set JDK_HOME="C:\Program Files (x86)\Java\jdk1.7.0_67" and update path environment variable as path="C:\Program Files (x86)\Java\jdk1.7.0_67\bin"
Note: Linux put the proper path.
Launch 32 bit application from /android-studio\bin folder.
I tested and verified these steps on windows 7 with 32 bit jdk1.7
It's probably because you don't have jdk installed in your machine. I had exact same problem in first run. Open a terminal (CTRL+ALT+T) and type: sudo apt-get install openjdk-7-jdk
When done setup Java environment variable. Steps as follows:
sudo gedit /etc/environment
Either in the beginning or end of the file write: JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386 (location may vary depending on the installation of your Java)
export JAVA_HOME
save and exit editor.
Load the path variable again using the terminal: . /etc/environment
Couple of helpful links for further clarifications:
How to install JDK on Ubuntu (Linux)?
How to set JAVA_HOME for OpenJDK?
Hope this helps.
On Windows 7 just run the studio.bat file in your android-studio/bin folder with right click as an administrator. Now you get ask to import previous studio settings. Ignore this and on the next dialog you can specify the path to your jdk directory.
That's all.
Marcel
I ran into this issue when I was referencing
[drive]:\Program Files\Java\jdk1.8.0_65
in my JAVA_HOME environment var instead of the Android Studio recommended
[drive]:\Program Files\Java\jdk1.7.0_79.
I am using the x64 version of the JDK on Windows 10 Pro.
From the Android Studio installation instructions.
Before you set up Android Studio, be sure you have installed JDK 6 or higher (the JRE alone is not sufficient)—JDK 7 is required when developing for Android 5.0 and higher. To check if you have JDK installed (and which version), open a terminal and type javac -version. If the JDK is not available or the version is lower than version 6, download the Java SE Development Kit 7
http://developer.android.com/sdk/installing/index.html?pkg=studio
You have 2 things you must check:
verify that /etc/environment file has the correct JAVA_HOME and PATH values referring to your Java installation directory.
verify that you have the correct Java version (maybe you are using a distribution of Linux which need a server version of Java) you may need this version like my case JRE for server.
On my Linux Mint 17.3 install, I found these instructions incredibly helpful.
The problem seems to boil down to the system's default Java being OpenJDK and Android Studio preferring Oracle's JDK. I actually did not perform the OpenJDK removal steps given in the tutorial, but only downloaded the Oracle JDK and set it as my system's default. Android Studio worked right away.
In case the linked page ever goes away, the steps I took were
Download Oracle JDK. Mine was version 1.7.0_79.
tar -zxvf jdk-7u79-linux-x64.tar.gz
sudo mkdir -p /opt/java
sudo mv jdk1.7.0_79 /opt/java
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/jdk1.7.0_79/bin/java" 1
sudo update-alternatives --set java /opt/java/jdk1.7.0_25/bin/java
and
java -version
confirms the system is using Oracle's JDK, giving output like
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
I am trying to build android source code in my Linux machine(Ubuntu 12.04 64bit). when I am start building it...i am getting error as follows
============================================
Checking build tools versions...
************************************************************
You are attempting to build with the incorrect version of java.
Your version is: java version "1.6.0_24". The correct version is: Java SE 1.6.
Please follow the machine setup instructions at
https://source.android.com/source/download.html
************************************************************
build/core/main.mk:141: *** stop. Stop.
I am able to understand the problem but I don't know how to change my java version because while installing jdk from terminal i am getting "1.6.0_24" version by default.
Please do needful.
Thanks In advance.
Install Java SE 1.6 and use sudo update-alternatives --config java to set to that java version.
You can download Java from here http://www.oracle.com/technetwork/java/javase/downloads/index.html
1.) If you’ve already installed OpenJDK (Or in ubantu generally it is already installed). Remove it by running this command:
sudo apt-get purge openjdk*
2.) Then:
sudo add-apt-repository ppa:webupd8team/java
Then update:
sudo apt-get update
3.) Select which version you want
To install Oracle Java 8:
sudo apt-get install oracle-java8-installer
To install Oracle Java 7:
sudo apt-get install oracle-java7-installer
To install the Java 6:
sudo apt-get install oracle-java6-installer
I'm experiencing the following problem when trying to run adb on Ubuntu 12.10, x86_64:
[2013-02-19 20:56:04 - adb] Unexpected exception 'Cannot run program
"/home/user/adt-bundle-linux-x86_64/sdk/platform-tools/adb": error=2,
No such file or directory' while attempting to get adb version from
'/home/user/adt-bundle-linux-x86_64/sdk/platform-tools/adb'
I located adb, tried chmod +x adb and it just doesn't work. I also tried chmod +x platform-tools/
and chmod +x tools/. After that I tried ./adb
I've Googgled for the problem. They were talking about ia32 package. Ubuntu can't locate that package nor the ia32 multi arch whatever.
System is Ubuntu 12.10 64 and I downloaded adt-bundle-linux-x86_64.zip package and just unzip it.
What am I doing wrong ? Thank you!
On Debian 7 I bumped in the same issue.
Diagnosis:
edb#lapelidb:~/today$ ldd /opt/adt-bundle-linux-x86_64-20130729/sdk/platform-tools/adb
not a dynamic executable
edb#lapelidb:~/today$ file /opt/adt-bundle-linux-x86_64-20130729/sdk/platform-tools/adb
/opt/adt-bundle-linux-x86_64-20130729/sdk/platform-tools/adb: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, not stripped
Solution: Adding support for 32-bit support and the required 32-bit libraries:
edb#lapelidb:~/today$ sudo dpkg --add-architecture i386
edb#lapelidb:~/today$ sudo apt-get update
edb#lapelidb:~/today$ sudo apt-get install libc6:i386 libstdc++6:i386
Et voila:
edb#lapelidb:~/today$ ldd /opt/adt-bundle-linux-x86_64-20130729/sdk/platform-tools/adb
linux-gate.so.1 => (0xf772a000)
librt.so.1 => /lib/i386-linux-gnu/i686/cmov/librt.so.1 (0xf770a000)
libdl.so.2 => /lib/i386-linux-gnu/i686/cmov/libdl.so.2 (0xf7706000)
libpthread.so.0 => /lib/i386-linux-gnu/i686/cmov/libpthread.so.0 (0xf76ec000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf7600000)
libm.so.6 => /lib/i386-linux-gnu/i686/cmov/libm.so.6 (0xf75da000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf75bd000)
libc.so.6 => /lib/i386-linux-gnu/i686/cmov/libc.so.6 (0xf745a000)
/lib/ld-linux.so.2 (0xf772b000)
I'm using Ubuntu 12.04 LTS version. I've tried the steps suggested by 'amo-ej1', but my 'dpkg' didn't have 'add' or 'architecture' options.
However, the following worked for me:
1) Install 'adb' and 'fastboot' provided by the following third-party PPA.
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot
2) Replace the copy of 'adb' and 'fastboot' provided by the official Android SDK with those installed from the above step:
cp /usr/bin/adb <path-to-your-adt-sdk-package>/sdk/platform-tools/adb
cp /usr/bin/fastboot <path-to-your-adt-sdk-package>/sdk/platform-tools/fastboot
3) Restart(re-execute) your eclipse binary.
Full credits:
http://www.webupd8.org/2012/08/install-adb-and-fastboot-android-tools.html
IMPORTANT EDIT (ALTERNATE SOLUTION):
Although the above would resolve your error (and you can proceed with the Android App tutorial), as I found, ADT will also need 'aapt' (another 32-bit binary) located in:
<path-to-your-adt-sdk-package>/sdk/build-tools/android-x.x/
And unfortunately, the link that I provided above doesn't provide this binary.
So, here's my other solution:
1) Update your system
Open 'Update Manager' => 'Settings' => 'Updates
Check "Recommended Updates (precise updates)"
Update the updates that are being shown
2) Install ia32-libs
sudo apt-get install ia32-libs
And I finally was able to install 'ia32-libs'. To know why 'ia32-libs' wouldn't install in the first place, please read the answer posted by 'slangasek' here:
https://askubuntu.com/questions/136394/cannot-install-ia32-libs
On Ubuntu 12.10 x86_64 the package to run 32bits are ia32-libs and ia32-libs-multiarch.
If you type
file adb
You'll see that adb is a 32 bit file on a 64 bit system. You need the ia32 packages to emulate and run this file. But you can't!
The problem right now is you cannot download these packages, they're trying to convert it to something I guess x86_64. Here you can read about convert in the package NEWS:
summary of the conversion:
"ia32-libs (20090808ubuntu27) precise; urgency=low
ia32-libs is now a transitional package depending on
ia32-libs-multiarch,
the i386-only package which depends on all the 32-bit library packages
previously included in ia32-libs itself. As a result, ia32-libs will be
uninstallable for some time during the precise cycle, while the dependent
libraries are updated to be coinstallable using multiarch. Developers
are encouraged to help with the conversion process for these libraries,
described at:
http://wiki.debian.org/Multiarch/Implementation
-- Steve Langasek "
So if you try to edit your source.list file to grab it from older repo you'll break packages. So ubuntu 12.10 people have to wait or adb is compile or whatever to 64 bit.
edit:
Debian 7.0 will support multiarch where x64 version can run x32 binary.
source: http://www.debian.org/News/2013/20130504
I use debian_x64
add i386 lib
dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
ldd /home/yourname/adt-bundle-linux-x86_64-20130729/sdk/platform-tools/adb
when you found “android-sdks/build-tools/17.0.0/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory”
you can try
sudo apt-get install ia32-libs
sudou apt-get install zlib.i686
restart your computer
and try again
unzip that file with this:
sudo tar xvfz adt-bundle-linux-x86.zip -C /opt/android
than run that code:
sudo chown -R your_user_name /opt/android
i think it will work
I've been trying all day to compile the Android source code on my Ubuntu 12.04 64bit OS.
For some reason, I'm stuck on the phase of having the Sun/Oracle JDK 1.6 version installed. I've been trying many commands (and the official link of course) and I end up either having nothing, having JDK 1.7 or OpenJDK, or not having the jdk-tools.
What are the exact steps to successfully compile the code (or part of it) using JDK? I'm stuck at the phase of "make j4" on this link.
installing the proper java version(1.6) for android do the below
1) Installing JDK
Since Sun JDK is no longer in Ubuntu’s main package repository, we have to manually install it in ubuntu 12.04 from oracle website
Please go the below link and download the JDK
http://www.oracle.com/technetwork/java/javase/downloads/jdk6-downloads-1637591.html
Follow the below steps to install the java and configuring it for the usage
$ chmod +x jdk-6u33-linux-x64.bin
$ sudo ./jdk-6u33-linux-x64.bin
$ sudo mv jdk1.6.0_33 /usr/lib/jvm/
$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_33/bin/java 1
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_33/bin/javac 1
$ sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_33/bin/javaws 1
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config javaws
To verify the isntallation is proper do the belwo steps. It should now show that the Sun JDK is running instead of IcedTea
$ java -version
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)
For compiling android on ubuntu 12.04 and installing the proper java version
visit http://www.embeddedcircle.com/android-compilation-in-ubuntu-12-04-lts-precise-for-pandaboard/
thanks
dino
In Ubuntu, when you download the jdk (32-bit version if it is for android programming, and in my opinion better the tar.gz than the .rpm one) it is important to 'install' and also to export using the commands you can see in the page of Oracle if I'm not wrong. You also need to go to your editor (Eclipse, Netbeans or which one?) and add the new Java platform to make sure you are using the version of the JDK you want to.To export means that you can compile the project when you want to.If not,you have to go to the java directory and inside the /bin folder do the command (probably with sudo at the beginning) to compile your project.
P.S.: You can find how to export here
I got this same problem. Some people reporting even JDK SE will see errors.
Another work-around is modifying two lines of source code, see here:
https://github.com/CyanogenMod/android_external_guava/commit/c8b97210aa31c9b80b5fd136d8617ebe4e731e09