Setting Up Eclipse and Android Studio
These applications don't require a formal installation process. Simply download the tar archives, extract them, and they're ready to run. The critical consideration is ensuring JDK compatibility.
Step 1: Remove OpenJDK
Linux Mint and most Linux distributions come with OpenJDK pre-installed, which must be removed first.
# Remove existing JDK installations
sudo apt-get purge openjdk*
# Clean up related packages
sudo apt-get purge icedtea-* openjdk-*
Step 2: Download Oracle JDK
Download from: https://www.oracle.com/java/technologies/javase-downloads.html
Available versions include JDK 14, JDK 11, and JDK 8. Choose based on your requirements. For learning purposes, JDK 14 is suitable, while specific versions may be needed for compatibility.
Using JDK 14 as an example:
- Click "JDK Download" under Oracle JDK
- For Ubuntu-based distributions, select "Linux Debian Package"
- Download speed may be slow; consider using aria2c for multi-threaded download
# Install aria2c if not available
sudo apt install aria2c
# Use aria2c for faster download
aria2c "download_url_here"
After downloading, double-click the package file to install.
Step 3: Configure Environment Variables
# Install text editor
sudo apt install gedit
# Open profile configuration
sudo gedit /etc/profile
Add the following at the end of the file:
JAVA_HOME=/usr/lib/jvm/jdk-14 # Verify actual location with 'whereis java' command
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export PATH
export CLASSPATH
Use 'source' command for temporary refresh or restart the system for full effect.
Step 4: Download Eclipse and Android Studio
Eclipse: https://www.eclipse.org/downloads/packages/
- Select "Linux 64-bit"
- Choose a mirror location (preferably China for faster downloads)
Android Studio: https://developer.android.google.cn/studio/
- Download the package
- Accept the license agreement
After downloading, right-click and extract to your desired directory. Navigate to the extracted folder to run the applications.
Alternatively, move the extracted folders to /opt and create desktop shortcuts for easier access.