Category: Eclipse

Fixing Issues with Android ADT Plugin

I have been having trouble using my Android Development Tools ever since I upgraded my Eclipse.  Here is what I went through:

Some possibilities:

First, I tried to uninstall the plugin, and that was quite challenging.  I finally found this article that explains how to do it.

  • Go to the Help > About Eclipse dialog
  • Click the “Installation Details” button
  • Click on the plugin in the list on the first tab.  (You have to do each Android plugin individually)
  • Click the Uninstall button at the bottom of the screen
  • Click finish in the next dialog
  • Once uninstalled, I clicked “Not Now” to repeat the process without rebooting.  After uninstalling all the Android plugins, I clicked the “Restart Now” button.

Next, I opened the Error Log view with Window > Show View > Error Log.  I clicked on the Clear Log Viewer so that I could see only the new messages.  Then, I installed just the first Android plugin from the Update Site.

When the plugin install opened the restart dialog, I still didn’t see any messages in my Error Log view.  So, I just clicked “Restart Now”.  Even after the restart, I didn’t see any messages relating to the install.  Doesn’t make sense!

So, let’s try the permission thing.  I am copying the security over to make the eclipse directory accessible to everyone:

sudo chmod g=u -R /usr/lib/eclipse
sudo chmod o=u -R /usr/lib/eclipse

Note, I found the chmod command option to copy the permissions from a PDF that Google turned up.

After that, it worked!  So, I guess it really was a security issue.  I can see the DDMS option in the Preferences and the DDMS Perspective can be opened from the Window menu.

Upgrading Eclipse to 3.6

I just realized while trying to install Visual Editor, that Eclipse has a new version.  I am using 3.5, but 3.6 is available.

I could just download eclipse from their website, but that would be too easy!  I guess I was hoping that if I use the repository, the packaging team would keep it up to date.

I found this thread discussing upgrading.  They say it doesn’t work, but I thought I would give it a try myself.  Worst cast, I could download it manually like #11 describes.

So, I went to Synaptic and opened the Settings > Repositories.  Then, I added the repository:

deb https://launchpad.net/~eclipse-team/+archive/debian-package lucid main

When I clicked Reload on Synaptic, I got this error message:

Failed to fetch https://launchpad.net/~eclipse-team/+archive/debian-package/dists/lucid/main/binary-amd64/Packages.gz  The requested URL returned error: 404
Some index files failed to download, they have been ignored, or old ones used instead.
Failed to fetch https://launchpad.net/~eclipse-team/+archive/debian-package/dists/lucid/main/binary-amd64/Packages.gz  The requested URL returned error: 404Some index files failed to download, they have been ignored, or old ones used instead.

I wonder if it is because I am running the 64bit version of Ubuntu.

Anyway, since it didn’t work, I downloaded eclipse from the Eclipse website.  Then, I extracted the tar ball into my Downloads directory.  From the command line, I changed directory into the newly created eclipse directory.  Then, I ran this command to copy it to /usr/lib —

sudo cp -r * /usr/lib/eclipse/

One thing to keep in mind is that you probably want to write down what extensions you have installed and the sites so that you can reinstall them.

Resources

Ubuntu Forums: Update Eclipse 3.5 to 3.6

Google Code and Mylyn

Since I am using Eclipse with my Google Code projects(Project Shaphan & Project Sarah), I did some research to see if I could connect Mylyn and found this project: GoogleCode Mylyn Connector.

To install it, I had to add this URL to the install sites:

http://knittig.de/googlecode-mylyn-connector/update/

Then, it installs through the Eclipse installation tool.

Next, I added a repository with the “New Task” menu on the right side of the Tasks view.  This walks through the wizard.

  • Step 1: Select repository type: Google Code
  • Step 2: Repository Settings
    • Project URL: http://code.google.com/p/project-shaphan/
    • Label: Project Shaphan (I believe this is the label you will see on the category)
    • Unchecked “Anonymous” (since I am the owner of the project)
    • entered user name and password
    • clicked “Validate Settings”
    • Clicked Finish
  • Yes to create a new query
  • Use a predefined query — All open issues

For some reason, I get the following error: “could not execute query”.  Then, I found this Issue.  The solution is to use the regular Google Account user name and password that you would use to login to GMail as opposed to one you would use to connect via SVN.

Eclipse on Karmic (Ubuntu 9.10)

After installing Ubuntu 9.10, I realized that they have updated the version of Eclipse in the repositories.  So, I was able to install it with apt-get rather than download it manually.  Here is the version information from the About screen:

Eclipse SDK
Version: 3.5.1
Build id: M20090917-0800
(c) Copyright Eclipse contributors and others 2000, 2009.  All rights reserved.
Visit http://www.eclipse.org/platform

Eclipse SDK
Version: 3.5.1Build id: M20090917-0800
(c) Copyright Eclipse contributors and others 2000, 2009.  All rights reserved.Visit http://www.eclipse.org/platform

The one thing I had to add was the plugins that I use.  First, I found a blog post with instructions on adding a repository with additional plugins via packages.  To use it, add this repository to your software sources:

deb http://ppa.launchpad.net/yogarine/eclipse/ubuntu karmic main

This command will import the key:

wget http://www2.yogarine.com/eclipse-ppa.key -O- | sudo apt-key add - && sudo apt-get update

So, with that said, here are the packages that I installed:

  • eclipse
  • eclipse-rcp
  • eclipse-platform
  • eclipse-emf
  • eclipse-platform-data
  • eclipse-pde
  • eclipse-plugin-cvs
  • eclipse-wtp
  • eclipse-dtp
  • eclipse-jdt
  • eclipse-gef

Then, I added the following update sites to Eclipse.  Open the preferences with the menu: Window > Preferences.  Then, go to Install/Update > Available Software Sites.

I added Visual Swing.  See this earlier post for more information.  Here is the update site:

  • http://visualswing4eclipse.googlecode.com/svn/trunk/vs4e/

For MyLyn, I found a conversation that recommended the following two sites:

  • http://download.eclipse.org/tools/mylyn/update/e3.4
  • http://download.eclipse.org/tools/mylyn/update/extras

To install the plugins, go to Help > Install New Software.

Visual Swing

I found a nice Swing Designer for Eclipse called Visual Swing:

Eclipse Zone: Visual Swing for Eclipse

This is a project hosted on Google Code.  So far, it has worked pretty nice.  It is by no means a commercial solution, but it definitely gets the job done.

I had a little trouble installing it from the Update Site.  The first time, I just downloaded the files and manually placed them in my Eclipse Home directory.  But, today I figured out how to get the update site to work.

Here is the update site I had to use:

http://visualswing4eclipse.googlecode.com/svn/trunk/vs4e

Then, in the install window, I had to uncheck “Group items by category”.  Otherwise, it would say “There are no categorized items”.  Finally, the install window seems to have a refresh problem.  It was loading the items in the list, but it was not painting them.  I had to give it some time to load, then I had to resize the install window to make it repaint the list.

There is an outstanding bug on the Update Site: Issue #119.

Adding Eclipse Project to Git

I did an earlier post where I did this, but I felt like it was sloppy.  Also, I did not add files to be ignored.  So, here is how to add an existing Eclipse project to Git:

Step 1:  In a terminal, change directories to your Eclipse workspace and project (assuming it is called my-project)

cd ~/workspace/my-project

Step 2: intialize the repository

git init

Step 3: add any files you want to ignore — consider any test data that might contain real production data and also consider connection information

vi .git/info/exclude

Assuming you have an Apache Derby database called db, you would exclude all of the database and the log with the following two lines:

db
derby.log

If you want to exclude Eclipse specific files, you may choose to add the following two lines:

.classpath
.project

Step 4: Add your files to your new Git repository

git add .

Step 5: Commit your files to the repository

git commit -m "My-Project inital code"

Step 6: Tag your code with a version

git tag v1.0

Update: You may want to tag this way so other developers see your tag (thanks Dominic):

git tag -a -m "GIT v1.0" v1.0

Now, your git repository is created and contains the code from your Eclipse project.

Resources