Centos 64-bit detailed tutorials for installing AAPT, JDK, Tomcat _linux

Source: Internet
Author: User
Tags chmod constant locale centos


1. Install JDK


#View the system's own jdk
[root@localhost ~]# rpm-qa | grep jdk
Java-1.7.0-openjdk-1.7.0.79-2.5.5.4.el6.x86_64
Java-1.6.0-openjdk-1.6.0.35-1.13.7.1.el6_6.x86_64
#Uninstall the system comes with openjdk
[root@localhost ~]# rpm-e--nodeps java-1.6.0-openjdk-1.6.0.35-1.13.7.1.el6_6.x86_64
[root@localhost ~]# rpm-e--nodeps java-1.7.0-openjdk-1.7.0.79-2.5.5.4.el6.x86_64
#View jdk version
[root@localhost ~]# java-version
-bash:/ Usr/bin/java: Without that file or directory
#ok, uninstall succeeded!
#Install our own jdk below
#自己去download
[root@localhost ~]# cd/usr/local/java/jdk
#View catalog file
[root@localhost java]# ls
Jdk-7u79-linux-x64.tar.gz
#unzip
[root@localhost jdk]# tar-zxvf jdk-7u79-linux-x64.tar.gz
#Authorization
[Root@localhost jdk]# chmod +x jdk1.7.0_79/


Configure environment variables (to be configured later with Tomcat)



2. Install Tomcat



Download directory: TOMCAT7 download address


#view
[root@localhost java]# ls tomcat/
apache-tomcat-7.0.29.tar.gz
#unzip
[root@localhost tomcat]# Tar- ZXVF apache-tomcat-7.0.29.tar.gz 
#grant
[root@localhost jdk]# chmod +x apache-tomcat-7.0.29


3. Configure Environment variables


#edit profile file: Vim/etc/profile
Export java_home=/usr/local/java/jdk/jdk1.7.0_79
Export Calsspath= $JAVA _ Home/lib/*.*
Export path= $PATH: $JAVA _home/bin
Export tomcat_home=/usr/local/java/tomcat/ apache-tomcat-7.0.29
Export catalina_home=/usr/local/java/tomcat/apache-tomcat-7.0.29
#Save the file and quit!


Note: There are no spaces before and after the equals sign


# Make the settings take effect immediately:
[root@localhost jdk]# source/etc/profile
#View whether jdk is successfully installed
[root@localhost jdk]# java-version
Java Version "1.7.0_79"
Java (TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot (tm) 64-bit Server VM (build 24.79-b02, mixed mode)# Success!
#Start tomcat
[Root@localhost bin]# sh/usr/local/java/tomcat/apache-tomcat-7.0.29/bin/startup.sh
#View startup log
[ Root@localhost bin]# tail-f/usr/local/java/tomcat/apache-tomcat-7.0.29/logs/catalina.out
#visit tomcat
Http://192.168.81.115:8080/
#If you can't access it, go to the firewall
#Open firewall port command
#open 8080
[root@localhost bin]#/sbin/ Iptables-i input-p TCP--dport 8080-j ACCEPT
# access tomcat again
Http://192.168.81.115:8080/


Ok!



4. Installation AAPT



Download directory:



AAPT Download



Apktool.jar download #authorize [root@localhost apktool]# chmod +x aapt #execute [root@localhost apktool]#./aapt-bash:./AAPT:/lib/ld-lin Ux.so.2:bad ELF Interpreter: No file or directory # Then execute on 64-bit operating system. /AAPT command will report the above error #we need to install: glibc.i686,zlib.i686,libstdc++.i686 
# (1.) First step [root@ Localhost apktool]# yum install glibc.i686 [root@localhost apktool]#./aapt #./aapt:error while loading Sha Red Libraries:libz.so.1:cannot Open Shared object file:no such file or directory 
# ( 2.) Step two [root@localhost apktool]# sudo yum install zlib.i686 [root@localhost apktool]#./aapt #./aapt:error while loading Sha Red Libraries:libstdc++.so.6:cannot Open Shared object File:no such file or directory 
#(3.) Step three [root@localhost apktool]# sudo yum install libstdc++.i686 #跑./aapt version to see if the installation was successful
[root@localhost apktool]#./aapt V Ersion #Android Asset Packaging Tool, v0.2 #If the above instructions appear Success, 


or it can be run./aapt, if there is a big lump and the same thing at the bottom of the description of success; If you still have an error, go down. # (4) Fourth step [root@localhost Apktool]#./aapt #See the last sentence #Protected multilib versions: libstdc++-4.4.7-17.el6.i6!= libstdc++-4.4.7-16.el6.x86_64 #If you get an error, you need to upgrade! = later version, Execute [root@localhost apktool]# yum update libstdc++-4.4.7-16.el6.x86_64 [root@localhost apktool]#./aapt #./aapt:e Rror while loading shared libraries:libstdc++.so.6:cannot Open Shared object file:no such file or directory #also reported error, continue # (
5. Fifth step [root@localhost apktool]# yum install libstdc++.so.6 [root@localhost apktool]#./aapt Android Asset Packaging USAGE:AAPT L[ist] [-v] [-a] file.
{zip,jar,apk}
List contents of zip-compatible archive. AAPT D[ump] [--values] WHAT file. {APK}
[Asset [Asset ...]] Badging Print the label and icon for the app. declared in APK.
Permissions Print the permissions from the APK.
Resources Print the Resource table from the APK.
Configurations Print the configurations in the APK.
Xmltree Print the compiled xmls in the given assets.
XAstrings Print the strings of the given compiled XML assets. AAPT P[ackage] [-d][-f][-m][-u][-v][-x][-z][-m androidmanifest.xml ] \ [-0 extension [-0 extension ...]] [G TolErance] [-j jarfile] \ [--debug-mode] [--min-sdk-version val] [--target-sdk-version Val] \ [--app-version val] [--app-vers Ion-name TEXT] [--custom-package VAL] \ [--rename-manifest-package package] \ [--rename-instrumentation-target -package PACKAGE] \ [--UTF16] [--auto-add-overlay] \ [--max-res-version VAL] \ [-I base-package [-i base-package ...]] \ [ -A asset- Source-dir] [g class-list-file] [-p public-definitions-file] \ [-S resource-sources [-S resource-sources ...]] [F Apk-file]
[-j r-file-dir] \ [--product product1,product2,...] \ [Raw-files-dir [Raw-files-dir] ...] Package the Android resources. It would read assets and Are supplied with the-mas or raw-files-dir arguments.
The-j-p-f and-r options control which files are output. AAPT R[emove] [-v] file.
{zip,jar,apk} file1 [File2 ...]
Delete specified files from zip-compatible archive. AAPT A[DD] [-v] file.
{zip,jar,apk} file1 [File2 ...]
Add a file to zip-compatible archive. AAPT V[ersion] Print ProGram version. Modifiers:-A print android-specific data (resources, manifest) while listing-c specify which to include. The default is all configurations. The value of The parameter should be a comma separated list of configuration values. Locales should be specified as either a language or language-region pair. Some examples:en port,en Port,land,en_us If You put the special locale, zz_zz on the list, It would perform Pseudolocaliza tion on the "default locale, modifying all of the" strings so can look for strings that missed the internationalization Process. For example:port,land,zz_zz-d one or more device assets to include, separated by Commas- f force overwrite of existing F Iles-g specify a pixel tolerance to force images to grayscale, default 0-j specify a jar or zip file containing classes To include-k junk path of file (s) added-m make package directories under location Specified BY-Ju update existing PAC Kage s (add new, replace older, remove deleted files)
V Verbose output-x Create extending (non-application) resource ids-z require localization of resource attributes Marke D with Localization= "suggested"-a additional directory of which to find raw asset files-g A file to output Proguard Opti
ONS into. -F Specify the APK file to output-i add a existing package to base include Set-j specify where to output R.java RESOURC e constant Definitions-m Specify full path to Androidmanifest.xml to include in zip-p specify Where to output public res Ource definitions-s directory in which.
Multiple directories would be scanned and the the "the" and "the" the "the" and "right" take precedence. -0 specifies a additional extension for which such files would not be stored compressed in the. apk.
An empty string means to does compress any files at all. --debug-mode inserts android:debUggable= "true" in to the application node of the manifest, making the application Debuggab
Le even on production devices. --min-sdk-version Inserts AndroiD:minsdkversion in to Manifest.
If the version is 7 or higher, the default encoding for resources would be in UTF-8.
--target-sdk-version inserts android:targetsdkversion in to manifest.
--max-res-version ignores versioned resource directories the above value.
--values when used with "Dump resources" also includes resource values.
--version-code inserts android:versioncode in to manifest.
--version-name inserts android:versionname in to manifest.
--custom-package generate R.java into a different package.
--auto-add-overlay automatically add resources to that are only in overlays. --rename-manifest-package Rewrite The manifest so it package name is the package name given here. Relative class names (for example.
Foo) would be changed to absolute names with the "old package so" the code does not need to change. --rename-instrumentation-target-package Rewrite the manifest so and its instrumentation components target the Give N Package. Conjunction with --rename-manifest-package to fix tests against package that has been. --PRODUCTs which variant to choose for strings, have product variants--UTF16 changes default encoding for RE Sources to UTF-16.
Only useful as API level is set to 7 or higher where the default encoding is UTF-8. --non-constant-id make the resourc



The above information shows that the installation was successful!



You can upload a apk file and then perform the parsing apk



Directory:



Execution:./aapt d badging 1.apk



You can see the result output of the package name, version number, and so on information are resolved.



The above is a small set to introduce the CentOS 64-bit installation AAPT, JDK, Tomcat detailed tutorials, hope to help everyone, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.