Linux CentOS 6.9 Minimal 编译 OpenJDK 7
今天学习《深入理解Java虚拟机:JVM高级特性与最佳实践》一书,并动手在Linux系统上编译OpenJDK 7,初次搞不太顺利,特记录下编译操作细节。
一、前期准备
约定:工具默认安装目录是/usr/local/,若有源码,则源码存放在/usr/local/src/目录下,笔者用到的工具已打包上传到百度云:https://pan.baidu.com/s/1WhsQHJvduK75EBE8lQqq9g
1、编译需要的相关工具
yum -y install gcc gcc-c++ alsa-lib alsa-lib-devel libXrender libXrender-devel libXi-devel libXt-devel libXtst-devel cups cups-devel
2、FreeType
笔者使用的是freetype-2.4.0.tar.gz,下载地址:https://sourceforge.net/projects/freetype/files/freetype2/2.4.0/
tar -zxvf freetype-2.4.0.tar.gz # 解压
cd freetype-2.4.0
./configure && make && make install # 编译安装
3、Apache Ant
笔者使用的是apache-ant-1.9.7-bin.tar.gz,下载地址:https://archive.apache.org/dist/ant/binaries/
tar -zxvf apache-ant-1.9.7-bin.tar.gz # 解压
mv apache-ant-1.9.7 /usr/local/
ln -s /usr/local/apache-ant-1.9.7/bin/ant /usr/bin/ant # 软链接到bin
4、BootstrapJDK
笔者使用的是jdk-6u45-linux-x64,因为源码更多是使用Java写的,因此需要使用一个可用的JDK去编译(详见深入理解Java虚拟机第一章),OpenJDK解压目录下有个README-builds.html<OpenJDK Build README>,建议详看一遍,文档说使用JDK 6
下载jdk-6u45-linux-x64.bin,下载地址:http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html
./jdk-6u45-linux-x64.bin # 解压
mv jdk1.6.0_45 /usr/local/ # 移动目录
5、OpenJDK
下载OpenJDK 7,地址:http://download.java.net/openjdk/jdk7/promoted/b147/openjdk-7-fcs-src-b147-27_jun_2011.zip,文件校验码:http://download.java.net/openjdk/jdk7/promoted/b147/openjdk-7-fcs-src-b147-27_jun_2011.md5
wget http://download.java.net/openjdk/jdk7/promoted/b147/openjdk-7-fcs-src-b147-27_jun_2011.zip # 下载
unzip openjdk-7-fcs-src-b147-27_jun_2011.zip # 解压
mv openjdk openjdk7 # 更改目录名
mkdir /usr/local/openjdk7 # 创建编译结果存放目录
二、配置环境变量
vim /etc/profile # 在末尾加入以下内容注意各个目录Path
# openjdk 7 build
export ANT_HOME=/usr/local/apache-ant-1.9.7
export ALT_FREETYPE_HEADERS_PATH=/usr/local/include/freetype2
export ALT_FREETYPE_LIB_PATH=/usr/local/lib
export ALT_DROPS_DIR=/usr/local/src/openjdk7/drop
export ALT_BOOTDIR=/usr/local/jdk1.6.0_45
export ALT_JDK_IMPORT_PATH=/usr/local/jdk1.6.0_45
export ALT_OUTPUTDIR=/usr/local/openjdk7
export LANG=C # default: en_US.UTF-8
export HOTSPOT_BUILD_JOBS=8
export ALT_PARALLEL_COMPILE_JOBS=8
export SKIP_COMPARE_IMAGES=true
export USE_PRECOMPILED_HEADER=true
export ALLOW_DOWNLOADS=true
export SKIP_DEBUG_BUILD=false
export SKIP_FASTDEBUG_BUILD=true
export DEBUG_NAME=debug
unset JAVA_HOME
unset CLASSPATH
:wq # 写入磁盘
source /etc/profile # 刷新环境变量配置使之生效,建议echo下几个配置项确认生效,例:echo $LANG
cd openjdk7 # 进入OpenJDK解压目录
make sanity # 检查之前的配置是否正确,若无错误(Sanity check passed.)则OK,下面是笔者的执行结果宫参考
[root@dsp-centos--6_9 openjdk7]# make sanity
( cd ./jdk/make && \
make sanity HOTSPOT_IMPORT_CHECK=false JDK_TOPDIR=/usr/local/src/openjdk7/jdk JDK_MAKE_SHARED_DIR=/usr/local/src/openjdk7/jdk/make/common/shared EXTERNALSANITYCONTROL=true SOURCE_LANGUAGE_VERSION= TARGET_CLASS_VERSION= MILESTONE=internal BUILD_NUMBER=b00 JDK_BUILD_NUMBER=b00 FULL_VERSION=1.7.-internal-debug-root_2018_05_01_00_10-b00 PREVIOUS_JDK_VERSION=1.6. JDK_VERSION=1.7. JDK_MKTG_VERSION= JDK_MAJOR_VERSION= JDK_MINOR_VERSION= JDK_MICRO_VERSION= PREVIOUS_MAJOR_VERSION= PREVIOUS_MINOR_VERSION= PREVIOUS_MICRO_VERSION= ARCH_DATA_MODEL= VARIANT=DBG DEBUG_CLASSFILES=true COOKED_BUILD_NUMBER= ANT_HOME="/usr/local/apache-ant-1.9.7" ALT_OUTPUTDIR=/usr/local/openjdk7 ALT_LANGTOOLS_DIST=/usr/local/openjdk7/langtools/dist ALT_CORBA_DIST=/usr/local/openjdk7/corba/dist ALT_JAXP_DIST=/usr/local/openjdk7/jaxp/dist ALT_JAXWS_DIST=/usr/local/openjdk7/jaxws/dist ALT_HOTSPOT_IMPORT_PATH=/usr/local/openjdk7/hotspot/import BUILD_HOTSPOT=true ; )
make[]: Entering directory `/usr/local/src/openjdk7/jdk/make'
make[]: Leaving directory `/usr/local/src/openjdk7/jdk/make' Build Machine Information:
build machine = dsp-centos--6_9 Build Directory Structure:
CWD = /usr/local/src/openjdk7
TOPDIR = .
LANGTOOLS_TOPDIR = ./langtools
JAXP_TOPDIR = ./jaxp
JAXWS_TOPDIR = ./jaxws
CORBA_TOPDIR = ./corba
HOTSPOT_TOPDIR = ./hotspot
JDK_TOPDIR = ./jdk Build Directives:
BUILD_LANGTOOLS = true
BUILD_JAXP = true
BUILD_JAXWS = true
BUILD_CORBA = true
BUILD_HOTSPOT = true
BUILD_JDK = true
DEBUG_CLASSFILES =
DEBUG_BINARIES = Hotspot Settings:
HOTSPOT_BUILD_JOBS =
HOTSPOT_OUTPUTDIR = /usr/local/openjdk7/hotspot/outputdir
HOTSPOT_EXPORT_PATH = /usr/local/openjdk7/hotspot/import Bootstrap Settings:
BOOTDIR = /usr/local/jdk1..0_45
ALT_BOOTDIR = /usr/local/jdk1..0_45
BOOT_VER = 1.6. [requires at least 1.6]
OUTPUTDIR = /usr/local/openjdk7
ALT_OUTPUTDIR = /usr/local/openjdk7
ABS_OUTPUTDIR = /usr/local/openjdk7 Build Tool Settings:
SLASH_JAVA = /NOT-SET
ALT_SLASH_JAVA =
VARIANT = DBG
JDK_DEVTOOLS_DIR = /NOT-SET/devtools
ALT_JDK_DEVTOOLS_DIR =
ANT_HOME = /usr/local/apache-ant-1.9.
UNIXCOMMAND_PATH = /bin/
ALT_UNIXCOMMAND_PATH =
COMPILER_PATH = /usr/bin/
ALT_COMPILER_PATH =
DEVTOOLS_PATH = /usr/bin/
ALT_DEVTOOLS_PATH =
UNIXCCS_PATH = /usr/ccs/bin/
ALT_UNIXCCS_PATH =
USRBIN_PATH = /usr/bin/
ALT_USRBIN_PATH =
COMPILER_NAME = GCC4
COMPILER_VERSION = GCC4
CC_VER = 4.4. [requires at least 4.3.]
ZIP_VER = 3.0 [requires at least 2.2]
UNZIP_VER = 6.00 [requires at least 5.12]
ANT_VER = 1.9. [requires at least 1.7.]
TEMPDIR = /usr/local/openjdk7/tmp Build Directives:
OPENJDK = true
USE_HOTSPOT_INTERPRETER_MODE =
PEDANTIC =
DEV_ONLY =
NO_DOCS =
NO_IMAGES =
TOOLS_ONLY =
INSANE =
COMPILE_APPROACH = parallel
PARALLEL_COMPILE_JOBS =
ALT_PARALLEL_COMPILE_JOBS =
FASTDEBUG =
COMPILER_WARNINGS_FATAL = false
COMPILER_WARNING_LEVEL =
SHOW_ALL_WARNINGS =
INCREMENTAL_BUILD = false
CC_HIGHEST_OPT =
CC_HIGHER_OPT =
CC_LOWER_OPT =
CXXFLAGS = -g -fPIC -DCC_NOEX -W -Wall -Wno-unused -Wno-parentheses -fno-omit-frame-pointer -D_LITTLE_ENDIAN
CFLAGS = -g -fno-strict-aliasing -fPIC -W -Wall -Wno-unused -Wno-parentheses -pipe -fno-omit-frame-pointer -D_LITTLE_ENDIAN
BOOT_JAVA_CMD = /usr/local/jdk1..0_45/bin/java -XX:-PrintVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-LogVMOutput -Xmx512m -Xms512m -XX:PermSize=32m -XX:MaxPermSize=160m
BOOT_JAVAC_CMD = /usr/local/jdk1..0_45/bin/javac -J-XX:ThreadStackSize= -J-XX:-PrintVMOptions -J-XX:+UnlockDiagnosticVMOptions -J-XX:-LogVMOutput -J-Xmx512m -J-Xms512m -J-XX:PermSize=32m -J-XX:MaxPermSize=160m -encoding ascii -source -target -XDignore.symbol.file=true
BOOT_JAR_CMD = /usr/local/jdk1..0_45/bin/jar
BOOT_JARSIGNER_CMD = /usr/local/jdk1..0_45/bin/jarsigner
JAVAC_CMD = /usr/local/jdk1..0_45/bin/java -XX:-PrintVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-LogVMOutput -Xmx512m -Xms512m -XX:PermSize=32m -XX:MaxPermSize=160m -Xbootclasspath/p:/usr/local/openjdk7/langtools/dist/bootstrap/lib/javac.jar -jar /usr/local/openjdk7/langtools/dist/bootstrap/lib/javac.jar -g -source -target -encoding ascii -Xbootclasspath:/usr/local/openjdk7/classes
JAVAH_CMD = /usr/local/jdk1..0_45/bin/java -XX:-PrintVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-LogVMOutput -Xmx512m -Xms512m -XX:PermSize=32m -XX:MaxPermSize=160m -Xbootclasspath/p:/usr/local/openjdk7/langtools/dist/bootstrap/lib/javah.jar:/usr/local/openjdk7/langtools/dist/bootstrap/lib/javac.jar -jar /usr/local/openjdk7/langtools/dist/bootstrap/lib/javah.jar -bootclasspath /usr/local/openjdk7/classes
JAVADOC_CMD = /usr/local/jdk1..0_45/bin/java -XX:-PrintVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-LogVMOutput -Xmx512m -Xms512m -XX:PermSize=32m -XX:MaxPermSize=160m -Xbootclasspath/p:/usr/local/openjdk7/langtools/dist/bootstrap/lib/javadoc.jar:/usr/local/openjdk7/langtools/dist/bootstrap/lib/javac.jar:/usr/local/openjdk7/langtools/dist/bootstrap/lib/doclets.jar -jar /usr/local/openjdk7/langtools/dist/bootstrap/lib/javadoc.jar -bootclasspath /usr/local/openjdk7/classes Build Platform Settings:
USER = root
PLATFORM = linux
ARCH = amd64
LIBARCH = amd64
ARCH_FAMILY = amd64
ARCH_DATA_MODEL =
ARCHPROP = amd64
ALSA_VERSION = 1.1.
OS_VERSION = 2.6.-696.16..el6.x86_64 [requires at least 2.6]
OS_VARIANT_NAME = RedHat
OS_VARIANT_VERSION =
MB_OF_MEMORY = GNU Make Settings:
MAKE = make
MAKE_VER = 3.81 [requires at least 3.81]
MAKECMDGOALS = sanity
MAKEFLAGS = w
SHELL = /bin/sh Target Build Versions:
JDK_VERSION = 1.7.
MILESTONE = internal
RELEASE = 1.7.-internal-debug
FULL_VERSION = 1.7.-internal-debug-root_2018_05_01_00_10-b00
BUILD_NUMBER = b00 External File/Binary Locations:
USRJDKINSTANCES_PATH = /opt/java
BUILD_JDK_IMPORT_PATH = /NOT-SET/re/jdk/1.7./promoted/latest/binaries
ALT_BUILD_JDK_IMPORT_PATH =
JDK_IMPORT_PATH = /usr/local/jdk1..0_45
ALT_JDK_IMPORT_PATH = /usr/local/jdk1..0_45
LANGTOOLS_DIST = /usr/local/openjdk7/langtools/dist
ALT_LANGTOOLS_DIST = /usr/local/openjdk7/langtools/dist
CORBA_DIST = /usr/local/openjdk7/corba/dist
ALT_CORBA_DIST = /usr/local/openjdk7/corba/dist
JAXP_DIST = /usr/local/openjdk7/jaxp/dist
ALT_JAXP_DIST = /usr/local/openjdk7/jaxp/dist
JAXWS_DIST = /usr/local/openjdk7/jaxws/dist
ALT_JAXWS_DIST = /usr/local/openjdk7/jaxws/dist
HOTSPOT_DOCS_IMPORT_PATH = /usr/local/openjdk7/hotspot/import/docs
ALT_HOTSPOT_DOCS_IMPORT_PATH =
HOTSPOT_IMPORT_PATH = /usr/local/openjdk7/hotspot/import
ALT_HOTSPOT_IMPORT_PATH = /usr/local/openjdk7/hotspot/import
HOTSPOT_SERVER_PATH = /usr/local/openjdk7/hotspot/import/jre/lib/amd64/server
ALT_HOTSPOT_SERVER_PATH =
CACERTS_FILE = ./../src/share/lib/security/cacerts
ALT_CACERTS_FILE =
CUPS_HEADERS_PATH = /usr/include
ALT_CUPS_HEADERS_PATH = OpenJDK-specific settings:
FREETYPE_HEADERS_PATH = /usr/local/include/freetype2
ALT_FREETYPE_HEADERS_PATH = /usr/local/include/freetype2
FREETYPE_LIB_PATH = /usr/local/lib
ALT_FREETYPE_LIB_PATH = /usr/local/lib Previous JDK Settings:
PREVIOUS_RELEASE_PATH = USING-PREVIOUS_RELEASE_IMAGE
ALT_PREVIOUS_RELEASE_PATH =
PREVIOUS_JDK_VERSION = 1.6.
ALT_PREVIOUS_JDK_VERSION =
PREVIOUS_JDK_FILE =
ALT_PREVIOUS_JDK_FILE =
PREVIOUS_JRE_FILE =
ALT_PREVIOUS_JRE_FILE =
PREVIOUS_RELEASE_IMAGE = /usr/local/jdk1..0_45
ALT_PREVIOUS_RELEASE_IMAGE = Sanity check passed.
三、编译操作
make 2>&1 | tee $ALT_OUTPUTDIR/build.log # 编译,标准错误输出stderr重定向到标准输出stdout,将编译过程数据重定向到文件保存。
若编译失败,重新编译前先执行:make clean
若编译成功,提示信息如下:
-- Build times ----------
Target debug_build
Start 2018-04-30 23:30:30
End 2018-04-30 23:45:05
00:01:45 corba
00:03:32 hotspot
00:00:18 jaxp
00:00:24 jaxws
00:08:05 jdk
00:00:31 langtools
00:14:35 TOTAL
-------------------------
四、验证
进入/usr/local/openjdk7/bin(即$ALT_OUTPUTDIR/bin)目录,执行:./java -version
[root@dsp-centos-1-6_9 bin]# ./java -version
openjdk version "1.7.0-internal-debug"
OpenJDK Runtime Environment (build 1.7.0-internal-debug-root_2018_04_30_20_26-b00)
OpenJDK 64-Bit Server VM (build 21.0-b17-jvmg, mixed mode)
验证虚拟机
---------------------------------------------------------------------------------
# 将env.sh中的环境变量单独拎出来执行下,笔者直接执行env.sh没效果
# export JAVA_HOME=/usr/local/jdk1..0_45
# export LD_LIBRARY_PATH=.:${JAVA_HOME}/jre/lib/amd64/native_threads:${JAVA_HOME}/jre/lib/amd64:
# export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/jre/lib/i18n.jar
# export HOTSPOT_BUILD_USER="root in hotspot" [root@dsp-centos--6_9 jvmg]# export JAVA_HOME=/usr/local/jdk1..0_45
[root@dsp-centos--6_9 jvmg]# echo $JAVA_HOME # 确认下是否符合预期
/usr/local/jdk1..0_45
[root@dsp-centos--6_9 jvmg]# export LD_LIBRARY_PATH=.:${JAVA_HOME}/jre/lib/amd64/native_threads:${JAVA_HOME}/jre/lib/amd64:
[root@dsp-centos--6_9 jvmg]# echo $LD_LIBRARY_PATH
.:/usr/local/jdk1..0_45/jre/lib/amd64/native_threads:/usr/local/jdk1..0_45/jre/lib/amd64:
[root@dsp-centos--6_9 jvmg]# export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/jre/lib/i18n.jar
[root@dsp-centos--6_9 jvmg]# echo $CLASSPATH
.:/usr/local/jdk1..0_45/jre/lib/rt.jar:/usr/local/jdk1..0_45/jre/lib/i18n.jar
[root@dsp-centos--6_9 jvmg]# export HOTSPOT_BUILD_USER="root in hotspot"
[root@dsp-centos--6_9 jvmg]# echo $HOTSPOT_BUILD_USER
root in hotspot
---------------------------------------------------------------------------------
[root@dsp-centos--6_9 jvmg]# ./gamma -version
Using java runtime at: /usr/local/jdk1..0_45/jre
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
OpenJDK -Bit Server VM (build 21.0-b17-jvmg, mixed mode)
---------------------------------------------------------------------------------
[root@dsp-centos--6_9 jvmg]# ./test_gamma # 解八皇后问题
java full version "1.6.0_45-b06"
Using java runtime at: /usr/local/jdk1..0_45/jre
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
OpenJDK -Bit Server VM (build 21.0-b17-jvmg, mixed mode) . A1 B5 C8 D6 E3 F7 G2 H4
. A1 B6 C8 D3 E7 F4 G2 H5
. A1 B7 C4 D6 E8 F2 G5 H3
. A1 B7 C5 D8 E2 F4 G6 H3
. A2 B4 C6 D8 E3 F1 G7 H5
. A2 B5 C7 D1 E3 F8 G6 H4
. A2 B5 C7 D4 E1 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7 F5 G3 H6
. A8 B2 C5 D3 E1 F7 G4 H6
. A8 B3 C1 D6 E2 F5 G7 H4
. A8 B4 C1 D3 E6 F2 G7 H5
[root@dsp-centos--6_9 jvmg]#
五、笔者碰到的问题
1、java.lang.RuntimeException: time is more than 10 years from present
修改jdk/src/share/classes/java/util/CurrencyData.properties,将日期改为十年以内,JDK的Bug。
108行改为: AZ=AZM;2009-12-31-20-00-00;AZN,接下来的377、439、529、555行类似修改保存,重新编译。
2、/usr/local/openjdk7-debug/jaxws/build/xml_generated/build-drop-jaf_src.xml:96: Redirection detected from https to http. Protocol switch unsafe, not allowed.
原因是jdk7-jaf-2010_08_19.zip这个包下载不了导致的,解决方案:
将以下三个文件下载后置于OpenJDK解压后根目录下的drop目录下,
并在环境变量中加入配置:export ALT_DROPS_DIR=/usr/local/src/openjdk7/drop # 注意目录Path
jdk7-jaf-2010_08_19.zip,下载地址:https://netix.dl.sourceforge.net/project/jdk7src/input-archives/jdk7-jaf-2010_08_19.zip
jdk7-jaxws2_2_4-b03-2011_05_27.zip,下载地址:http://download.java.net/glassfish/components/jax-ws/openjdk/jdk7/jdk7-jaxws2_2_4-b03-2011_05_27.zip
jaxp145_01.zip,下载地址:http://download.java.net/jaxp/1.4.5/jaxp145_01.zip
以下是操作过程的命令:
mkdir /usr/local/src/openjdk7/drop
export ALT_DROPS_DIR=/usr/local/src/openjdk7/drop
cd /usr/local/src/openjdk7/drop
wget http://download.java.net/jaxp/1.4.5/jaxp145_01.zip
wget https://netix.dl.sourceforge.net/project/jdk7src/input-archives/jdk7-jaf-2010_08_19.zip
wget http://download.java.net/glassfish/components/jax-ws/openjdk/jdk7/jdk7-jaxws2_2_4-b03-2011_05_27.zip
六、参考资料:
Linux CentOS 6.9 Minimal 编译 OpenJDK 7的更多相关文章
- linux CentOS部署【minimal 】
1.为什么选择CentOS不选择其他版本:http://www.cnblogs.com/TeemoHQ/p/6377260.html 2.准备的资源:VMware[官网下载],CentOS镜像 [阿里 ...
- Linux(CentOS 7)使用gcc编译c,c++代码
安装gcc: 1.使用 yum -list gcc* 查询 centos 官方gcc的所有包: 可安装的软件包 gcc.x86_64 gcc-c++.x86_64 gcc-gfortran.x86_6 ...
- CentOS编译openjdk
编译openjdk 1. 下载openjdk源码 openjdk的官网是OpenJDK (java.net) 在网站左侧就能看到它的源码位置的链接 从图上可以看到,它的源码在两个位置有托管,Mercu ...
- 阿里云服务器Linux CentOS安装配置(九)shell编译、打包、部署
阿里云服务器Linux CentOS安装配置(九)shell编译.打包.部署 1.查询当前目录以及子目录下所有的java文件,并显示查询结果 find . -name *.java -type f - ...
- 在Linux CentOS上编译并安装Clang 3.5.0
编译CoreCLR需要Clang 3.5,而CentOS上安装的是Clang 3.4.2(yum repos中最新版也是这个),只能自己手工编译LLVM的源代码进行安装. (注:CentOS的版本是6 ...
- linux centos安装编译phantomjs 2.0的方法
phantomjs 2.0最新版的官方不提供编译好的文件下载,只能自己编译,有教程但是过于简单,特别是服务器上要安装N多的支持.折腾到现在终于装好了并且能正常运行了,截图mark一下: linux c ...
- Linux CentOS 7 安装PostgreSQL 9.5.17 (源码编译)
近日需要将PostgreSQL数据库从Windows中迁移到Linux中,Linux CentOS 7 安装PostgreSQL 9.5.17 安装过程 特此记录. 安装环境: 数据库:Postgre ...
- Linux CentOS 6.6安装JDK1.7
Linux CentOS 6.6安装JDK1.7 目录 1.下载JDK 2.卸载JDK 3.安装JDK 3.1..rpm后缀格式JDK安装方式 3.2..tar.gz后缀格式JDK安装方式 4.验证安 ...
- JVM学习——编译OpenJDK
最近在学习<深入理解java虚拟机 第二版>这本书.书中第一部分建议大家自己编译OpenJDK.抱着学习态度也来编译个玩一玩.下面进入正题. 1.编译环境介绍 操作系统 CentOS Li ...
随机推荐
- BZOJ.4319.[cerc2008]Suffix reconstruction(后缀数组 构造 贪心)
题目链接 \(Description\) 给定SA数组,求满足SA[]的一个原字符串(每个字符为小写字母),无解输出-1. \(Solution\) 假设我们现在有suf(SA[j]),要构造suf( ...
- 潭州课堂25班:Ph201805201 爬虫基础 第六课 选择器 (课堂笔记)
HTML解析库BeautifulSoup4 BeautifulSoup 是一个可以从HTML或XML文件中提取数据的Python库,它的使用方式相对于正则来说更加的简单方便,常常能够节省我们大量的时间 ...
- 潭州课堂25班:Ph201805201 WEB 之 HTML 第一课 (课堂笔记)
什么是HTML 超文本标记语言(HyperText Markup Language,简称 HTML) HTML 是一门标记语言,标记语言由一套标记标签组成, 学习 HTML,其实就是学习标签 HTML ...
- Struts2返回json数据xml中配置
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE struts PUBLIC "-/ ...
- git 添加远程仓库
你已经在本地创建了一个Git仓库后,又想在GitHub创建一个Git仓库,并且让这两个仓库进行远程同步,这样,GitHub上的仓库既可以作为备份,又可以让其他人通过该仓库来协作,真是一举多得. 首先, ...
- U3D面试题六
U3D面试题大全 1.Unity中碰撞器(Collider)和触发器(Trigger)的区别? 两方都必须要有碰撞体,且一方要有刚体,但在发生碰撞的条件下,Collide碰撞器会生产 碰撞反弹的物 ...
- 01-复杂度1 最大子列和问题(剑指offer和PAT)
01-复杂度1 最大子列和问题 (20分) 给定KK个整数组成的序列{ N1, N2, ..., NK },“连续子列”被定义为{ Ni, Ni+1, ..., N ...
- Android关于log日志,华为不输出log.v,log.d(zz)
[java] view plain copy 我用的是mate8,本来虚拟机测试一点日志一点问题没有 [java] view plain copy 但是真机测试发现log.d一直不输出,正好又试了lo ...
- Spark机器学习(12):神经网络算法
1. 神经网络基础知识 1.1 神经元 神经网络(Neural Net)是由大量的处理单元相互连接形成的网络.神经元是神经网络的最小单元,神经网络由若干个神经元组成.一个神经元的结构如下: 上面的神经 ...
- 修改和查询sqlserver里面的xml 好像只能一个个改不能批量
select [ExtendFieldId], [Setting].value('(/UploadFileViewModel/UploadProviderKey)[1]', 'nvarchar(max ...