Eclipse is one such IDE that is primarily used for Java development. It can also be used with other languages, such as — C++, PHP, etc. Other languages support can be added on top of an existing installation or they can be installed as separate Eclipse packages.
You can use other modern open-source code editors for programming but if you ask me, I’ll always vote for Eclipse. And so, today we are going see how we can install the latest version of Eclipse on Ubuntu.
Installing the latest Eclipse on Ubuntu Linux
The apt package manager provides an old version of Eclipse in Ubuntu. This is why I won’t recommend using sudo apt install eclipse.
Eclipse doesn’t provide an official PPA or an easy way to install the latest version of it on Ubuntu. However, we shall mention two easy methods you can follow to easily install Eclipse on Ubuntu or any other Linux distro.
Method 1: Installing Eclipse using Snap (Easy)
You can install the snap package available for Linux. You can either install it from the terminal or the software center in Ubuntu.
Open the Software Center application in Ubuntu and search for Eclipse and install it from there.
We also have a guide on using snap packages if you are not sure about the support for snap packages for your Linux distributions.
If you proceed to install it via the terminal, here’s what you have to type in:
sudo snap install eclipse --classic
Method 2: Installing Eclipse from the official package (Slightly Complicated)
Make sure you don’t confuse “package” with the installer available. You can find the latest package for Eclipse here.
It is also worth noting that we assume the directory ‘Downloads’ as your default storage path to save the Eclipse package downloaded. If you have a different path, replace the file path from our set of steps.
So, once you have downloaded the package for Linux, simply follow the steps mentioned below to complete the installation:
- Launch the terminal and enter the following command:
cd /opt
Next, you have to extract the downloaded package to this directory by entering the following command:
sudo tar -xvzf ~/Downloads/eclipse-jee-2019-09-R-linux-gtk-x86_64.tar.gz
- Now after extracting the files, we have to make a menu entry (so that when you search for Eclipse, an icon will come up in the app drawer). Here’s what to enter next:
sudo gedit eclipse.desktop
Basically, we are making the file for the shortcut icon here. Next, we need to set up the shortcut to launch Eclipse. So, when the text editor opens, enter the following information and save it (copy-paste what’s written below):
[Desktop Entry]
Name=Eclipse
Type=Application
Exec=/opt/eclipse/eclipse
Terminal=false
Icon=/opt/eclipse/icon.xpm
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE;
Name[en]=Eclipse
Name[en_US]=Eclipse
- Close the text editor and enter the following command to enable the shortcut icon:
sudo desktop-file-install eclipse.desktop
And, that’s it!
How To Setup Android SDK With Eclipse On Ubuntu
Now, I'm sitting for a short course about Android Programming for five days. So, I'd like to share my experience setting up Android SDK with Eclipse on Ubuntu 12.04 LTS Precise Pangolin with you. Let's get started.
System requirements:
You need to install Java Development Kit (JDK) to get the stuff work. Simply run the following command to install it:
sudo apt-get install openjdk-6-jdk
1. Android SDK for Linux
First thing first, you need to download Android SDK for Linux here. It's around 80MB so it might take a while to download. Once downloaded, run the following commands:
sudo cp -r android-sdk_r20.0.1-linux.tgz /opt
cd /opt
sudo tar xvzf android-sdk_r20.0.1-linux.tgz
sudo chmod -R 755 /opt/android-sdk-linux
Then run the SDK Manager to download necessary libraries and APIs:
cd /opt/android-sdk-linux/tools
sudo ./android sdk
Well, if you want to develop Android application for Android 2.3.3 then you should Android 2.3.3 (API 10). For further information about Android platforms and packages please click here.
2. Eclipse
For developing Android application, Eclipse 3.6 is recommended. You can download it here. Optionally, you can put the downloaded Eclipse into system folder so other users can use it:
sudo cp -r eclipse-java-helios-SR2-linux-gtk.tar.gz /usr/local
cd /usr/local
- sudo chmod a+x eclipse-java-helios-SR2-linux-gtk.tar.gz
- sudo tar xvzf eclipse-java-helios-SR2-linux-gtk.tar.gz
- #create Eclipse shortcut on Desktop
- cd ~/Desktop
- ln -s /usr/local/eclipse/eclipse
3. Installing ADT Plugin for Eclipse
In order to communicate with Android SDK Tools, Eclipse needs a plugin so called ADT plugin. Please open your Eclipse IDE, navigate to "Help > Install New Software ...", click "Add" in the top-right corner. In the Add Repository dialog that appears, enter "ADT Plugin" for the Name and the following URL for the Location:
http://dl-ssl.google.com/android/eclipse/
And then click OK. In the Available Software dialog, check the "Developer Tools" checkbox, click Next and follow on-screen instruction.
4. Configuring ADT Plugin
The last step you need to do is locating the Android SDK Tools to work with Eclipse. In Eclipse menu, select "Window > Preferences...", select "Android" from left panel, in the "SDK Location" click "Browse" and locate your Android SDK Tools (in this example: /opt/android-sdk-linux).
error PANIC: Missing emulator engine program for 'arm' CPU
Pesan kesalahan "PANIC: Missing emulator engine program for 'arm' CPU" pada Eclipse di Ubuntu biasanya muncul saat mencoba menjalankan emulator Android untuk CPU ARM. Berikut adalah beberapa langkah yang dapat Anda coba untuk memperbaiki masalah ini:
- Pastikan bahwa Anda telah menginstal paket emulator untuk CPU ARM di Ubuntu Anda. Anda dapat melakukannya dengan menjalankan perintah berikut di terminal:
sudo apt-get install libgl1-mesa-dev:i386
sudo apt-get install qemu-kvm
sudo apt-get install qemu-system-arm
`
- Setelah menginstal paket emulator, buka Eclipse dan pilih menu "Window" -> "Android Virtual Device Manager".
- Pilih AVD yang ingin Anda jalankan, kemudian klik "Edit".
- Di bawah opsi "CPU/ABI", pastikan Anda telah memilih "ARM" sebagai CPU.
- Klik "Finish" untuk menyimpan pengaturan dan keluar dari jendela edit AVD.
- Sekarang coba jalankan emulator lagi dan lihat apakah masalah telah teratasi.
- Jika masalah masih berlanjut, Anda mungkin perlu memeriksa versi emulator dan SDK Android Anda untuk memastikan bahwa semuanya kompatibel dengan sistem operasi Ubuntu Anda. Anda juga dapat mencoba menggunakan emulator Genymotion yang merupakan emulator alternatif yang lebih cepat dan stabil.
Konfigurasi SDK Command Tools
- Unzip file
- Create folder baru
android_sdk - Lalu masukkan hasil Unzip kedalam folder
android_sdk - Dalam folder
cmdline-toolsbuat folder baru dengan namalatestpindahkan semua file yang berda di foldercmdline-toolskedalam folderlatest. - Lalu masukkan perintah berikut
andoid_sdk/cmdline-tools/latest/bin/sdkmanager --update
andoid_sdk/cmdline-tools/latest/bin/sdkmanager "tools"
andoid_sdk/cmdline-tools/latest/bin/sdkmanager "platform-tools" "build-tools;29.0.2" "platforms;android-13"
- Disini menggunakan android versi 3