2

I'm new to to Linux, in this particular case, to Ubuntu. I have a small android project I have to finish until this Friday and I'm still stuck with the install and preparing of the development environment. The only thing I did was install the Eclipse IDE. I'm still missing the SDK, JAVA and anything else that might be needed. Can someone help me through this? It's only because I'm running out of time to develop, or else I would embark on a deeper investigation of this OS.

nanofarad
  • 20,717
csbl
  • 691

1 Answers1

1

Installing the Android SDK to use with Eclipse works the same way on Ubuntu as it does on other Linux-based operating systems. You should follow the instructions in the official documentation.

As of the time of this writing, that means you'll download this SDK package, then follow the instructions in Installing the SDK.

Install the Android SDK Itself

To summarize the Android SDK installation instructions, you'll download the SDK, unpack it wherever you want it, and remember where you unpacked it because you'll be providing that information in Eclipse later, when setting up the ADT plugin (see below). If you have no other preference, a good place for the Android SDK is directly in your home directory (not the Downloads folder it may have been saved to, but to the home directory, which contains your downloads folder, your Documents folder, your Desktop folder, and so forth). To extract the Android SDK, put the .tar.gz file wherever you want it, then right-click on it and click Extract Here.

  • The Android SDK contains 32-bit programs and libraries. This is fine even if you are running the 64-bit version of Ubuntu. But if you're running the 64-bit version of Ubuntu, you probably only already have the 32-bit versions of the libraries that the Android SDK relies on installed. The easiest way to install the 64-bit versions of these libraries is by installing the ia32-libs package. This works on all versions of Ubuntu. See this question for details.

Install a JDK If You Don't Have One Already

The installation instructions give you a link to where you can download Oracle's proprietary JDK (Java). If you choose to use the Oracle's proprietary JDK, this answer explains how to install it from the command-line with the packages available on Oracle's website.

  • If you prefer to use the OpenJDK, you can install do this by installing the openjdk-7-jdk package in the Software Center ...or by running this command in the Terminal (Ctrl+Alt+T):

    sudo apt-get update
    sudo apt-get install openjdk-7-jdk
    

    The installation instructions say to use JDK 6 (which you can do by installing openjdk-6-jdk), but they link to version 7 of Oracle's proprietary JDK, so the Android SDK will probably work fine with the latest OpenJDK as well.

The installation instructions explicitly recommend that Ubuntu users see the community documentation on Java and Java installation, if experiencing any problems.

Install the ADT Plugin for Eclipse

As explained in the installation instructions, you'll install the ADT plugin for Eclipse, which is what lets you use Eclipse to develop Android applications.

Install Android Development Packages In Eclipse

In Eclipse, you'll pick what Android development packages you want to install. Different packages are required for targeting different versions of the Android operating system for different devices, and for using various additional functionality implemented by some mobile device manufacturers. You can have however many of these packages installed at the same time as you wish (although if you select a lot of them, it may take a while for them to download and install before you can begin developing for Android). The installation instructions explain how to decide what you need.

Eliah Kagan
  • 117,780
  • I downloaded both: -jdk-7u4-linux-x64.tar.gz and

    -android-sdk_r18-linux.tar.gz

    How do I install them? Just unpack them? If so, to where? Home\PersonnalFolder? If not, then how?

    – csbl Jun 06 '12 at 16:56
  • Ok, I understand why the ADT plugin gave the error message...I didn't have the jdk installed...And still haven't. You say that the open jdk works the same? Do I have to add or configure any variable environment? – csbl Jun 06 '12 at 17:01
  • @csbl I think those errors are actually because you didn't install the Android SDK, not because you didn't install the JDK (though you do have to do that too). You should only have to do post-install configuration for a JDK yourself if you have more than one JDK installed and want to change which one is the default. It should work fine with openjdk--that's what I've used to make Android apps using Eclipse. But Oracle's proprietary JDK will work fine too and this explains how to install it from the .tar.gz file. – Eliah Kagan Jun 06 '12 at 17:04
  • After those instructions, I think I'll pass and execute the commands: 'sudo apt-get update sudo apt-get install openjdk-7-jdk'.

    To which folder or directory should I unpack the 'android-sdk_r18-linux.tar.gz'? Mine is on the 'Path Home\PersonnalFolder'. Within that 'android-sdk_r18-linux.tar.gz', after unpacked, there is nothing on the 'platforms' folder. It should be empty? One last, stupid question...Is that all I have to do? Extract it? It's the problem of being used to the windws *.exe...

    – csbl Jun 06 '12 at 17:10
  • I just executed the two steps you gave me for openjdk7. Anything else I should do about the installation of the jdk? The environment variable path? If so, how to? – csbl Jun 06 '12 at 17:14
  • I've opened the AVD Manager, from Eclipse, and I am now trying to install the paltform packages. I hope it goes well. – csbl Jun 06 '12 at 17:16
  • @csbl No, you don't need to do anything else to set up the JDK. If in doubt, you can run javac -version from the command-line to check that it's installed, and file /etc/alternatives/javac to check that it's really provided by the JDK. By the way, I added information about installing the Android SDK to my answer. – Eliah Kagan Jun 06 '12 at 17:17
  • If, like I asked, there is anything else I have to set up abiut the jdk or rhe sdk manager, please tell me. How to I get the *.ks file? – csbl Jun 06 '12 at 17:17
  • @csbl Besides what is now detailed in my answer and described in the official installation instructions, there is nothing more you have to do, to install the JDK or the SDK Manager. In particular, all you have to do to set up OpenJDK is install the one package for it, which you have done. I don't know what you're asking, regarding .ks files--can you explain in greater detail? – Eliah Kagan Jun 06 '12 at 17:20
  • the javac -version connabd gives me the javac 1.6.0_24. Shouldn't it be something like javac 1.7...? – csbl Jun 06 '12 at 17:21
  • @csbl Yes, if you are using openjdk-7-jdk rather than openjdk-6-jdk, the version number should start with 1.7 (probably javac 1.7.0_03). What's the output of file /etc/alternatives/javac? – Eliah Kagan Jun 06 '12 at 17:23
  • I used 'sudo apt-get install openjdk-7-jdk' command. The 'file /etc/alternatives/javac' is:

    symbolic link to `/usr/lib/jvm/java-6-openjdk-amd64/bin/javac'

    – csbl Jun 06 '12 at 17:24
  • @csbl It seems you also have openjdk-6-jdk installed, then. You can either keep using that (it will work fine for this purpose) or, if you prefer, switch to the openjdk using update-alternatives (I recommend that Eclipse not be running when you do this). – Eliah Kagan Jun 06 '12 at 17:31
  • I maintained the jdk6. I created an android project and I got the following error:

    [2012-06-06 18:44:40 - contactManager] /home/catia/android-sdks/platform-tools/aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory

    – csbl Jun 06 '12 at 17:46
  • I now have another folder in the same place I extracted the android sdk tar.gz file. it's named 'android-sdks'. could the error be related to this? Should they be only one folder? Perhaps I have to move content from one to another... – csbl Jun 06 '12 at 17:57
  • @csbl No, I don't think that could be causing this. I'm guessing you weren't able to enter the chat room you created because you don't have enough reputation? (There's an official way around this but it doesn't seem to always work.) You should update your question with the details of what's going wrong currently. – Eliah Kagan Jun 06 '12 at 17:59
  • That thing about the chat has to be done by you, I guess. And yes, it's because I do not have enough rep. I updated the question – csbl Jun 06 '12 at 18:06
  • @csbl I had created this chat room for us before and tried to give you access to chat in it. Are you able to use that room? BTW, you should either unaccept my answer or post a new question, because right now it looks like this issue is solved and other people who can help might not know you need help. (Because your current problems are a direct extension of the original question, I strongly recommend that you unaccept my answer. You can always reaccept it later once the problem is solved.) – Eliah Kagan Jun 06 '12 at 18:13
  • I'm not able to chat there. i posted another question...If you can help, I would really appreciate! – csbl Jun 06 '12 at 18:19
  • I'll help if I can. By the way, here's the transcript of most of this conversation (which will be there even if mods clean things up here). And here's the new question where the newer, related problem is being worked on. – Eliah Kagan Jun 06 '12 at 18:28
  • The transcript I could see, through the chatroom. It was the only thing I could see there, actually. Thank you! – csbl Jun 06 '12 at 18:30
  • @csbl Right, I posted the transcript for the benefit of others (and me, and you) if most of the comments here get deleted. Which, after we verify that my answer to your new question works for you, we should probably do ourselves, as long comment threads are looked down upon... – Eliah Kagan Jun 06 '12 at 18:40