64-bit Fedora25 and Android development environment configuration

Tsinghua Tongfang Elite V41 has been used for nearly 8 years this year. Although the machine has a 23-inch wide screen and the memory has been upgraded to 4G, the Pentium dual-core E6500 with a main frequency of only 2.93GHz is struggling to run Win10. However, the 32-bit Fedora 18 has been used all the time, all kinds of software are complete, and the performance is OK. A few weeks ago, I accidentally found out that the Pentium E6500 is a 64-bit processor, so I upgraded to the 64-bit version of the latest Fedora25.

After installation, it is found that compared with the original Fedora18, the system changes are relatively large. First of all, Fedora25 uses WayLand instead of X by default, and GNOME has also been upgraded to 3.22.2. The system has built-in MTP connection mode that supports Android, so that you can directly import photos and files when you connect to your mobile phone. Then there is the command-line installation tool from yum to dnf, and the graphical RPM package management tool can no longer be seen, replaced by gnome-software. However, when using dnf to install warehouse software, it is basically the same as yum. The following are several commonly used installation and configuration commands, which can facilitate the use of GNOME:

install gnome-tweak-tool, set the desktop to store files, the maximum window, Minimize button:
dnf install gnome-tweak-tool

Install 7zip, rar and multimedia encoding and VLC player:
dnf install p7zip p7zip-plugins
rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
dnf install unrar
dnf install ffmpeg ffmpeg-libs gstreamer-ffmpeg  xvidcore libdvdread libdvdnav lsdvd
dnf install gstreamer-plugins-good  gstreamer-plugins-bad gstreamer-plugins-ugly
dnf install vlc
dnf install mozilla-vlc

Install Remote Desktop for Windows:
dnf install remmina

Add the function of right-clicking to open the terminal:
dnf install nautilus-open-terminal

Install exfat format, support large-capacity U disk:
dnf install fuse-exfat

These are commonly used. Fedora25 comes with smart pinyin and can be used. To use the Wubi input method, you can directly enter the "wubi" keyword in the software installation program provided by the system (that is, gnome-software). GNOME-SOFT provides Extreme Wubi and Haifeng Wubi. Personally, I feel that Haifeng is easier to use.

The compatibility of LibreOffice that comes with Fedora to Microsoft Office is much better, but I still downloaded the 64-bit Linux version of Yongzhong Office2016 from Yongzhong's official website to prepare for installation. During installation, it was found that after switching to the root user in the default WayLand, the installation program did not work properly. Fortunately, you can choose X11 instead of WayLand when you log in, so that you can install Yongzhong Office. After installation, if you switch back to WayLand, Yongzhong Office can still work normally.

The JDK1.8 in the Fedora25 software repository is the same as Oracle's official version number, and basically there is no need to download it from Oracle's official website. Originally, Android Studio 2.2 can still be used on 32-bit Fedora 18, but it can't be used on 64-bit Fedora 25. Eclipse+ADT+Android SDK runs relatively smoothly, but the Android SDK for Linux provided by Google seems to have many problems running on pure 64-bit Linux. For example, when creating a virtual machine, it always prompts mksdcard that the library libgcc_s.so.1 cannot be found, but in fact this library is in the /usr/lib64 directory, which means that Google's Android SDK for Linux still needs 32 Bit library files to ensure its normal operation, this problem can be solved by the following command:
dnf install libstdc++.*

In addition to this, install the additional 32-bit libraries required by the SDK with the following command:
dnf install zlib.i686 ncurses-libs.i686 bzip2-libs.i686


In addition, in Linux, choose the X86 emulator image provided by Google to create a virtual machine, and the startup speed will indeed be much faster.

Since Google stopped the development of the Eclipse plug-in ADT in June last year, the ADT+Eclipse bundles currently downloaded from the Android developer's official website are all based on earlier Eclipse Juno versions. Using the ADT plugin on the latest Eclipse Neon version seems to have compatibility issues, and the new version of the ADT project handed over by Google to the Eclipse organization is not very available at the moment. Considering that the JEE version of Eclipse can be used for Android and server-side development at the same time, I downloaded the JEE version of Juno directly from the Eclipse website, and then integrated the ADT downloaded from the Android developer official website into the eclipse/plugins directory of the Eclipse package. Copy all the files to the corresponding folder in Juno after decompression, and you can directly develop Android and JavaEE in Eclipse.

When developing with ADT, be sure to pay attention to the version of the JDK or JRE you use. The PATH environment variable of the system may be modified due to the installation of other software (such as Yongzhong Office), which will cause other lower versions of JRE to be used by Eclipse in preference to the system's JDK1.8, which may cause "com/" to appear when compiling the Andorid project. android/dx/command/dexer/Main: Unsupported major.minor version 52.0" error. At this point, you only need to ensure that the java command of JDK1.8 is at the top of the environment variable PATH. One method is to add the following two lines at the end of the system's /etc/profile file to set the environment variables JAVA_HOME and PATH respectively:
export JAVA_HOME=<replace here with the path where JDK1.8 is located>
export PATH=$JAVA_HOME:$PATH

Or directly edit the eclipse.ini file in the directory where the eclipse executable is located, and add
-vm
<replace with the path where JDK1.8 is located>/bin/java

In 64-bit Fedora25, the available location of JDK1.8 provided by the system is /usr/lib/jvm/java-1.8.0 (actually this location is /usr/lib/jvm/java-1.8.0-openjdk- 1.8.0.121-1.b14.fc25.x86_64 folder symlink). If you use the system's openjdk, replace the angle brackets and the contents of the above instructions with /usr/lib/jvm/java-1.8.0.

Set time zone:
export TZ='Asia/Shanghai'

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326678726&siteId=291194637