openJDK环境搭建编译(完整版)

1.安装VMware  VMware-workstation-full-10.0.7-2844087.exe
    破解码:HY06L-F334P-9Z6H9-6R2XM-23C6J
  安装完成之后,Downloading VMware Tools for Linux - version 9.2.0
2.下载源码openJDK源码
    http://download.java.net/openjdk/jdk7/promoted/b147/openjdk-7-fcs-src-b147-27_jun_2011.zip
3.Fedora   用户名:mutong 密码:123456
Installing VMware Tools,please wait.....
mount:special device /dev/hda does not exist
4.共享文件夹在虚拟机上面的路径/mnt/hgfs/linux镜像
   把openjdk-7-fcs-src-b147-27_jun_2011.zip拷贝到桌面
   从home/文件夹  copy 到 usr/local/java
 OpenJDK编译之路
1.到OpenJDK目录下面运行 make sanity 进行检测
  检测结果如下:

  WARNING: LANG has been set to en_US.UTF-8, this can cause build failures. 
         Try setting LANG to 'C'. 
 
ERROR: The version of ant being used is older than 
       the required version of '1.7.1'. 
       The version of ant found was ''. 
 
ERROR: You seem to not have installed ALSA 0.9.1 or higher. Please install ALSA (drivers and lib). You can download the source distribution from http://www.alsa-project.org or go to http://www.freshrpms.net/docs/alsa/ for precompiled RPM packages.  ERROR: FreeType version 2.3.0 or higher is required. make[2]: Entering directory `/usr/local/java/openjdk/jdk/make/tools/freetypecheck' /bin/mkdir -p /usr/local/java/openjdk/build/linux-i586/btbins rm -f /usr/local/java/openjdk/build/linux-i586/btbins/freetype_versioncheck make[2]: Leaving directory `/usr/local/java/openjdk/jdk/make/tools/freetypecheck' Failed to build freetypecheck. ERROR: You do not have access to valid Cups header files. Please check your access to /usr/include/cups/cups.h and/or check your value of ALT_CUPS_HEADERS_PATH, CUPS is frequently pre-installed on many systems, or may be downloaded from http://www.cups.org  Exiting because of the above error(s). make: *** [post-sanity] Error

 开始解决错误:
卸载OpenJDK
  1. 执行命令rpm -qa|grep jdk
  java-1.6.0-openjdk-plugin-1.6.0.0-44.1.9.1.fc14.i686
  java-1.6.0-openjdk-1.6.0.0-44.1.9.1.fc14.i686
  2. 执行卸载命令
  yum -y remove java java-1.6.0-openjdk-1.6.0.0-44.1.9.1.fc14.i686

Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
Setting up Remove Process
Removing java-1.6.0-openjdk.i686 1:1.6.0.0-44.1.9.1.fc14 - e from the transaction
Resolving Dependencies
--> Running transaction check
---> Package java-1.6.0-openjdk.i686 1:1.6.0.0-44.1.9.1.fc14 set to be erased
--> Processing Dependency: java-1.6.0-openjdk = 1:1.6.0.0-44.1.9.1.fc14 for package: 1:java-1.6.0-openjdk-plugin-1.6.0.0-44.1.9.1.fc14.i686
--> Running transaction check
---> Package java-1.6.0-openjdk-plugin.i686 1:1.6.0.0-44.1.9.1.fc14 set to be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package             Arch Version
                             Repository                                    Size
================================================================================
Removing:
 java-1.6.0-openjdk  i686 1:1.6.0.0-44.1.9.1.fc14
                             @anaconda-InstallationRepo-201010211814.i386  83 M
Removing for dependencies:
 java-1.6.0-openjdk-plugin
                     i686 1:1.6.0.0-44.1.9.1.fc14
                             @anaconda-InstallationRepo-201010211814.i386 191 k

Transaction Summary
================================================================================
Remove        2 Package(s)

Installed size: 83 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing        : 1:java-1.6.0-openjdk-plugin-1.6.0.0-44.1.9.1.fc14.i686   1/2 
  Erasing        : 1:java-1.6.0-openjdk-1.6.0.0-44.1.9.1.fc14.i686          2/2 

Removed:
  java-1.6.0-openjdk.i686 1:1.6.0.0-44.1.9.1.fc14                               

Dependency Removed:
  java-1.6.0-openjdk-plugin.i686 1:1.6.0.0-44.1.9.1.fc14                        

Complete!

linux 安装jdk 1.7 32位
1.下载:
http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html
wget http://uni-smr.ac.ru/archive/dev/java/bulk/jdk-7u21-linux-i586.rpm
2.安装:
rpm -ivh jdk-7u21-linux-i586.rpm
Preparing...                ########################################### [100%]
   1:jdk                    ########################################### [100%]
Unpacking JAR files...
 rt.jar...
 jsse.jar...
 charsets.jar...
 tools.jar...
 localedata.jar...
 jfxrt.jar...
 plugin.jar...
 javaws.jar...
 deploy.jar...
查看安装路径 echo $JAVA_HOME
/usr/local/java/jdk1.7.0_40
3.修改profile:
sudo vi /etc/profile
//最后面加入
JAVA_HOME=/usr/local/java/jdk1.7.0_40
CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOEM/lib/dt.jar
PATH=$JAVA_HOME/bin:$PATH
export ALT_BOOTDIR=/usr/local/java/jdk1.7.0_80
export ALLOW_DOWNLOADS=true 
export USE_PRECOMPILED_HEADER=true 
export SKIP_DEBUG_BUILD=false 
export SKIP_FASTDEBUG_BUILD=true 
export DEBUG_NAME=debug 
unset CLASSPATH 
unset JAVA_HOME 
4.保存:
 #source /etc/profile
5.验证成功:
# java -version
 在Linux上安装ant环境
1、从http://ant.apache.org 上下载tar.gz版ant
2、复制到/usr下
3、tar -vxzf apahce-ant-1.9.2-bin.tar.gz  解压
4、chown -R yjdabc apahce-ant-1.9.2  改变权限
    chown -R :users apahce-ant-1.9.2
   chmod -R +x apahce-ant-1.9.2
5、vi /etc/profile    修改系统配置文件
    #set Ant enviroment
    ANT_HOME=/usr/local/java/apache-ant-1.7.0
    ANYPATH=$ANTPATH:$ANT_HOME/bin
    unset ANT_HOME
6、source /etc/proifle   立刻将配置生效
7、ant -version   测试ant是否生效
  安装alsa-lib 包含ALSA库函数  声卡
  ftp://ftp.alsa-project.org/pub/lib/
  alsa-lib-1.1.6.tar.bz2  tar -xvf alsa-lib-1.1.6.tar.bz2
  进入目录:cd alsa-lib-1.1.6.tar.bz2
  执行命令# ./configure
          # make install
  安装Freetype
  https://download.savannah.gnu.org/releases/freetype/
  freetype-2.5.3.tar.gz
  执行命令 # ./configure
           # make
           #sudo make install
  编译完成之后如果还报错 在目录include
  cp -r freetype2/* ./

猜你喜欢

转载自www.cnblogs.com/mutong1228/p/8995273.html