Install Android SDK in Ubuntu

来源:互联网 发布:中国移动宽带提速软件 编辑:程序博客网 时间:2024/05/01 11:19

 

 

1.      vmware中安装Linux (Ubuntu)

2.      Linux的某个目录共享给Windows

a)       apt-get install samba smbfs

b)       vi /etc/samba/smb.conf, 添加:

                     i.            [share_to_window]

                   ii.                    comment = Directory

                  iii.                    path = /linux/share

                  iv.                    browseable = yes

                   v.                    writeable = yes

                  vi.                   create mask = 644

                vii.                   directory mask = 755

 

c)       smbpasswd -a root

 

 

 

web上的资源:

转自www.Androidin.com,我改了一点点。。。

一般而言,作为一个linux使用者,我是很忌讳用源里的东西的,更新慢、拥有root权限不说,而且我也不太信任源。

1.
直接从www.sun.com下载最新的JAVASE稳定版本JDK 6 Update7

2.
直接从www.eclipse.org下载最新的Eclipse版本Eclipse IDE for Java Developers85M那个,其他的Android也用不着。

3.
直接从http://code.google.com/android/download_list.html下载最新的Android SDK1.1(打不开的可以用代理或者在网上搜一下)

4.
安装androideclipse插件,这个具体步骤在http://code.google.com/android/i ... ml#installingplugin上有。不过有个地方需要说明下:在在线安装Eclipse 3.4 (Ganymede)的插件安装方法中,给出的地址可能有问题,如果按照教程上的不行,则更改为http://dl-ssl.google.com/android/eclipse/

5.
解压缩JDKAndroid SDKeclipse到一个文件夹下,我就喜欢放在 ~/local/ 这个目录下。追求细节上完美的玩家可以自行配置JAVA_HOMEln -S等,这里就没必要罗嗦了

6.
启动Eclipsewindow -> Preferences -> android -> SDK Location,在这里指定Android SDK的目录就大功告成了。



个人提示:Eclipse虽然很强大,但是从个人角度还是推荐不要所有功能都集中在一个Eclipse中完成,分成几个独立的Eclipse来安装不同的 插件是一个不错的选择。这样可以避免插件之间、插件Eclipse版本的冲突,也可以避免一个非常SUCK的情况:Android for Eclipse的插件有内存泄漏!这实在是..实在是太SUCK

 

 

我的步骤:

 

Step 1: 下载一些东西:

 

JDK 6 Update 7

https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewFilteredProducts-SingleVariationTypeFilter

 

Eclipse

http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/ganymede/SR2/eclipse-java-ganymede-SR2-linux-gtk.tar.gz

 

Android SDK 1.5:

http://www.android123.com.cn/sdkxiazai/289.html

http://dl.google.com/android/android-sdk-linux_x86-1.5_pre.zip

 

 

 

国外一个比较详细的步骤:

http://androidforums.com/developer-101/2321-installing-eclipse-android-sdk-ubuntu-8-04-8-10-a.html

 

Note: In this tutorial, I'm using Xubuntu 8.04. These steps are the same for Ubuntu and Kubuntu as well. They're also the exact same for [Xu|Ku|U]buntu 8.10.

The first thing we need to do is download all of the needed files. First up, the Android SDK. You can download it from http://code.google.com/android/download.html

We're also going to need Eclipse. Head over to http://www.eclipse.org/downloads/. The version we want is Eclipse IDE for Java Developers. The JEE version will work as well.



Next, we're going to need Java. Bring up a terminal window (Applications -> Accessories -> Terminal). We can install it using apt, by running...

sudo apt-get install sun-java6-bin



(If you're using a 64 bit distribution, you'll also need to install the ia32-libs as well)

Once it's done downloading the files, it will prompt you about the license.



Press tab, and then enter. It will tell you that you have to accept the license to continue, and then prompt you again. Select yes, and press enter to continue.



Now that Java is installed, we can get started on Eclipse. First, let's untar/gzip Eclipse. In our terminal window...

cd ~/Desktop

And then untar/gzip the file.

tar xvfz eclipse-jee-ganymede-SR1-linux-gtk.tar.gz



Finally, move it into your home folder.

mv eclipse ~



Now, if you want to add eclipse to your menu, right click on Applications and Edit Menu. Click on Programming, and then click New Item. Type in the name, and the full location to Eclipse (/home/yourusername/eclipse/eclipse), and finally, click OK.

Personally, I just made a launcher for it on my Desktop.



Now, let's extract the Android SDK. Back in the terminal again...

unzip android-sdk-linux_x86-1.0_r1.zip



Let's move the resulting folder into our home folder.

mv android-sdk-linux_x86-1.0_r1/ ~



Now, this is the single most important step. Without this, we'll encounter all sorts of odd problems later. Open up your ~/.bashrc in your favorite editor (because I'm doing this in Xubuntu, I'm using mousepad. You can use whatever you'd like.)

sudo mousepad ~/.bashrc

And we're going to add the following at the bottom of the file (making sure you replace yourusername with your actual username.)

export PATH=${PATH}:/home/yourusername/android-sdk-linux_x86-1.0_r1/tools



Save the changes, and exit your editor. Now, we can start up Eclipse.

Eclipse will prompt you to choose a workspace location.



This is where all of your project files will be stored. Set it where you want, and click OK.

Once Eclipse is started up, we can add the ADT plugin. In the menu, Help -> Software Updates.



Click on the Available Software tab, and then Add Site. For the location, we're going to enter http://dl-ssl.google.com/android/eclipse/



And click OK. Eclipse will go find the list of available software, and update your list.



Click the checkbox next to the Location we just added to select all of the software, and click Install.



Eclipse will calculate all of the requirements and download the needed files. Then you'll be greeted by the Install window.



Click Next to install the selected tools. You'll be asked to agree to the license.



Accept the license agreement, and then click Finish. Eclipse will install everything...



...And then will prompt you to restart, click Yes. Eclipse will restart.

The last thing we need to do is point the ADT plugin to our Android SDK folder. In the top menu, go to Window -> Preferences, and then click on the Android tab.



Click Browse, choose the Android SDK folder, and then click OK. Now click Apply and let Eclipse crunch on it for a second or two.



And click OK. You're finished!

To run a quick test and make sure everything is working properly, go to File -> New -> Project. Expand Android, click on Android Project, and click Next.



Now we'll have to fill in our project information. Because this is a test run, we'll call the project testrun. For the package name, we'll use com.android.test. And last but not least, the activity name will be test.



Click Finish.

Eclipse will crunch on that for a second, and open the project in the left pane. Expand the main tree to see the file structure of a default new project. The last thing we need to do before we run our test application is set up a run configuration. In the menu, go to Run -> Run Configurations...

Double click on Android Application and it will create a new configuration. Give the configuration a name, and click browse for the project.



Choose your project, click OK. Now click Apply, then Run.

You'll notice the bottom pane switches over to Console. This will let you know what's going on with the emulator. After a few seconds, the emulator will start up.



Note that the first run will take *much* longer than usual to start up, as it's setting up the Android OS while it starts up for the first time. Depending on the specs of your computer, it can take anywhere from a few minutes to over half an hour.

After awhile, you'll arrive at the starting screen. Usually, you'll get a few errors as things start up and can't be started.



I usually just click wait. In the console, you'll see it install, and then start up your application.





And with that, it's time for you to dive into the code and start making your application.

 

 

另外一个比较详细的:

http://www.howtoforge.com/installing-google-android-sdk1.0-on-ubuntu8.04-desktop

 

 

安装jdk:

Linuxubuntu8.04 LST)环境下安装JDK6

Linuxubuntu8.04 LST)环境下安装JDK6

1
、下载

   jdk-6u7-linux-i586.bin
2
、修改可执行权限

   chmod 744 jdk-6u7-linux-i586.bin
3
、执行

   ./jdk-6u7-linux-i586.bin
    
本步骤执行之后,会在当前目录下产生一个jdk1.6.0_07目录

4
、在/usr/local下创建一个jdk6目录

   cd /usr/local & sudo mkdir jdk6
5
、将前面jdk1.6.0_07中的内容复制到jdk6目录下

   sudo cp -R /home/guandl/installs/jdk1.6.0_07/* .
6
、设置环境变量

/etc/profile文件末尾增加一下内容

export JAVA_HOME=/usr/local/jdk6
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin

注意:如果jdk只安装给某个用户使用

首先,把安装的目录改到个人目录下,

然后,通过修改该用户的环境配置文件来设置上面的环境变量,如下面的两个文件之一

/home/anyuser/.bashrc
/home/anyuser/.profile

7
、退出重新登录之后,测试安装是否成功

$ echo $JAVA_HOME
$ echo $CLASSPATH
$ echo $PATH
$ java -version
如果都正常,安装成功

 

 

原创粉丝点击