Running generated-configure.sh configure: Configuration created at Wed Feb 12 22:27:32 EST 2020. configure: configure script generated at timestamp 1468207795. checking for basename... /usr/bin/basename checking for bash... /bin/bash ... ... ... ==================================================== A new configuration has been successfully created in /home/lanbing/openjdk/openjdk-jdk8u/build/linux-x86_64-normal-server-release using default settings.
Configuration summary: * Debug level: release * JDK variant: normal * JVM variants: server * OpenJDK target: OS: linux, CPU architecture: x86, address length: 64
Tools summary: * Boot JDK: openjdk version "1.8.0_242" OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08) OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode) (at /usr/lib/jvm/java-8-openjdk-amd64) * C Compiler: x86_64-linux-gnu-gcc-7 (Ubuntu 7.4.0-1ubuntu1~18.04.1) version 7.4.0 (at /usr/bin/x86_64-linux-gnu-gcc-7) * C++ Compiler: x86_64-linux-gnu-g++-7 (Ubuntu 7.4.0-1ubuntu1~18.04.1) version 7.4.0 (at /usr/bin/x86_64-linux-gnu-g++-7)
Build performance summary: * Cores to use: 1 * Memory limit: 2963 MB * ccache status: installed, but disabled (version older than 3.1.4)
WARNING: The result of this configuration has overridden an older configuration. You *should* run 'make clean' to make sure you get a proper build. Failure to do so might result in strange build problems.
2 . 执行make命令进行编译,编译成功, 将会出现下面提示
1 2 3 4 5 6 7 8 9 10 11 12
----- Build times ------- Start 2020-02-17 12:00:21 End 2020-02-17 12:18:17 00:00:37 corba 00:11:06 hotspot 00:00:21 jaxp 00:00:30 jaxws 00:05:22 jdk 00:00:00 langtools 00:17:56 TOTAL ------------------------- Finished building OpenJDK for target 'default'
Building OpenJDK for target 'default' in configuration 'linux-x86_64-normal-server-release'
## Starting langtools Compiling 2 files for BUILD_TOOLS Compiling 32 properties into resource bundles Compiling 782 files for BUILD_BOOTSTRAP_LANGTOOLS Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Creating langtools/dist/bootstrap/lib/javac.jar Compiling 785 files for BUILD_FULL_JAVAC Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Creating langtools/dist/lib/classes.jar Updating langtools/dist/lib/src.zip ## Finished langtools (build time 00:01:04)
## Starting hotspot
*** This OS is not supported: Linux ubuntu1804 5.3.0-28-generic #30~18.04.1-Ubuntu SMP Fri Jan 17 06:14:09 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux /home/lanbing/openjdk/openjdk-jdk8u/hotspot/make/linux/Makefile:242: recipe for target 'check_os_version' failed /home/lanbing/openjdk/openjdk-jdk8u/hotspot/make/linux/Makefile:263: recipe for target 'linux_amd64_compiler2/debug' failed Makefile:230: recipe for target 'generic_build2' failed Makefile:177: recipe for target 'product' failed HotspotWrapper.gmk:44: recipe for target '/home/lanbing/openjdk/openjdk-jdk8u/build/linux-x86_64-normal-server-release/hotspot/_hotspot.timestamp' failed make[5]: *** [check_os_version] Error 1 make[4]: *** [linux_amd64_compiler2/debug] Error 2 make[3]: *** [generic_build2] Error 2 make[2]: *** [product] Error 2 make[1]: *** [/home/lanbing/openjdk/openjdk-jdk8u/build/linux-x86_64-normal-server-release/hotspot/_hotspot.timestamp] Error 2 /home/lanbing/openjdk/openjdk-jdk8u//make/Main.gmk:108: recipe for target 'hotspot-only' failed make: *** [hotspot-only] Error 2
/home/lanbing/openjdk/openjdk-jdk8u/hotspot/src/os/linux/vm/os_linux.inline.hpp:127:42: error: 'int readdir_r(DIR*, dirent*, dirent**)' is deprecated [-Werror=deprecated-declarations] if((status = ::readdir_r(dirp, dbuf, &p)) != 0) { ^ In file included from /home/lanbing/openjdk/openjdk-jdk8u/hotspot/src/os/linux/vm/jvm_linux.h:44:0, from /home/lanbing/openjdk/openjdk-jdk8u/hotspot/src/share/vm/prims/jvm.h:30, from /home/lanbing/openjdk/openjdk-jdk8u/hotspot/src/share/vm/utilities/debug.hpp:29, from /home/lanbing/openjdk/openjdk-jdk8u/hotspot/src/share/vm/runtime/globals.hpp:28, from /home/lanbing/openjdk/openjdk-jdk8u/hotspot/src/share/vm/memory/allocation.hpp:28, from /home/lanbing/openjdk/openjdk-jdk8u/hotspot/src/share/vm/memory/iterator.hpp:28, from /home/lanbing/openjdk/openjdk-jdk8u/hotspot/src/share/vm/memory/genOopClosures.hpp:28, from /home/lanbing/openjdk/openjdk-jdk8u/hotspot/src/share/vm/oops/klass.hpp:28, from /home/lanbing/openjdk/openjdk-jdk8u/hotspot/src/share/vm/runtime/handles.hpp:28, from /home/lanbing/openjdk/openjdk-jdk8u/hotspot/src/share/vm/memory/universe.hpp:28, from /home/lanbing/openjdk/openjdk-jdk8u/hotspot/src/share/vm/code/oopRecorder.hpp:28, from /home/lanbing/openjdk/openjdk-jdk8u/hotspot/src/share/vm/asm/codeBuffer.hpp:28, from /home/lanbing/openjdk/openjdk-jdk8u/hotspot/src/share/vm/asm/assembler.hpp:28, from /home/lanbing/openjdk/openjdk-jdk8u/hotspot/src/share/vm/precompiled/precompiled.hpp:29: /usr/include/dirent.h:183:12: note: declared here extern int readdir_r (DIR *__restrict __dirp, ^~~~~~~~~ cc1plus: all warnings being treated as errors make[6]: *** [precompiled.hpp.gch] Error 1 /home/lanbing/openjdk/openjdk-jdk8u/hotspot/make/linux/makefiles/vm.make:309: recipe for target 'precompiled.hpp.gch' failed /home/lanbing/openjdk/openjdk-jdk8u/hotspot/make/linux/makefiles/top.make:119: recipe for target 'the_vm' failed /home/lanbing/openjdk/openjdk-jdk8u/hotspot/make/linux/Makefile:298: recipe for target 'product' failed Makefile:230: recipe for target 'generic_build2' failed Makefile:177: recipe for target 'product' failed HotspotWrapper.gmk:44: recipe for target '/home/lanbing/openjdk/openjdk-jdk8u/build/linux-x86_64-normal-server-release/hotspot/_hotspot.timestamp' failed make[5]: *** [the_vm] Error 2 make[4]: *** [product] Error 2 make[3]: *** [generic_build2] Error 2 make[2]: *** [product] Error 2 make[1]: *** [/home/lanbing/openjdk/openjdk-jdk8u/build/linux-x86_64-normal-server-release/hotspot/_hotspot.timestamp] Error 2 /home/lanbing/openjdk/openjdk-jdk8u//make/Main.gmk:108: recipe for target 'hotspot-only' failed make: *** [hotspot-only] Error 2
protected Object createBean(final String beanName, final RootBeanDefinition mbd, final Object[] args) throws BeanCreationException { // Make sure bean class is actually resolved at this point. // 将bean标签中class属性解析为Class类 resolveBeanClass(mbd, beanName);
protected Object doCreateBean(final String beanName, final RootBeanDefinition mbd, final Object[] args) { // Instantiate the bean. BeanWrapper instanceWrapper = null; // 如果是单例,看是否存在FactoryBean缓存,这个缓存主要是在调用 isTypeMatch() 或 getType() 检查类型匹配或者获取类型后缓存起来的 if (mbd.isSingleton()) { instanceWrapper = this.factoryBeanInstanceCache.remove(beanName); } if (instanceWrapper == null) { // 创建Bean实例,并返回Bean的包装实例 instanceWrapper = createBeanInstance(beanName, mbd, args); } final Object bean = (instanceWrapper != null ? instanceWrapper.getWrappedInstance() : null); Class beanType = (instanceWrapper != null ? instanceWrapper.getWrappedClass() : null);
// Allow post-processors to modify the merged bean definition. synchronized (mbd.postProcessingLock) { if (!mbd.postProcessed) { // post-processors 可以在此修改definition applyMergedBeanDefinitionPostProcessors(mbd, beanType, beanName); mbd.postProcessed = true; } }
// Eagerly cache singletons to be able to resolve circular references // even when triggered by lifecycle interfaces like BeanFactoryAware. boolean earlySingletonExposure = (mbd.isSingleton() && this.allowCircularReferences && isSingletonCurrentlyInCreation(beanName)); // 这里的目的就是解决循环依赖的问题 if (earlySingletonExposure) { addSingletonFactory(beanName, new ObjectFactory() { public Object getObject() throws BeansException { return getEarlyBeanReference(beanName, mbd, bean); } }); }
public void init() { // 注册解析器 BeanDefinitionParser registerBeanDefinitionParser("property-placeholder", new PropertyPlaceholderBeanDefinitionParser()); registerBeanDefinitionParser("property-override", new PropertyOverrideBeanDefinitionParser()); registerBeanDefinitionParser("annotation-config", new AnnotationConfigBeanDefinitionParser()); registerBeanDefinitionParser("component-scan", new ComponentScanBeanDefinitionParser()); registerBeanDefinitionParser("load-time-weaver", new LoadTimeWeaverBeanDefinitionParser()); registerBeanDefinitionParser("spring-configured", new SpringConfiguredBeanDefinitionParser()); registerBeanDefinitionParser("mbean-export", new MBeanExportBeanDefinitionParser()); registerBeanDefinitionParser("mbean-server", new MBeanServerBeanDefinitionParser()); }
public int loadBeanDefinitions(Resource[] resources) throws BeanDefinitionStoreException { Assert.notNull(resources, "Resource array must not be null"); int counter = 0; for (Resource resource : resources) { // 遍历所有资源 进行解析 counter += loadBeanDefinitions(resource); } return counter; }
public int loadBeanDefinitions(Resource resource) throws BeanDefinitionStoreException { return loadBeanDefinitions(new EncodedResource(resource)); }
//启动容器 ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml")
//更换为绝对路径,启动失败 ApplicationContext context = new ClassPathXmlApplicationContext( "E:\\IDEA_workspace\\SpringLearningDemo\\spring-java\\src\\main\\resources\\applicationContext.xml");
//报 FileNotFoundException:Caused by: java.io.FileNotFoundException: class path resource [E:/IDEA_workspace/SpringLearningDemo/spring-java/src/main/resources/applicationContext.xml] cannot be opened because it does not exist
//使用 FileSystemXmlApplicationContext 正常启动 ApplicationContext context = new FileSystemXmlApplicationContext( "E:\\IDEA_workspace\\SpringLearningDemo\\spring-java\\src\\main\\resources\\applicationContext.xml"); // 启动成功 ApplicationContext context = new FileSystemXmlApplicationContext( "classpath:applicationContext.xml"); // 启动成功 ApplicationContext context = new ClassPathXmlApplicationContext( "file:E:\\IDEA_workspace\\SpringLearningDemo\\spring-java\\src\\main\\resources\\applicationContext.xml");
[root@VM_72_235_centos ~]# vi .bashrc [root@VM_72_235_centos ~]# cat .bashrc # .bashrc # User specific aliases and functions alias rm='rm -i' alias cp='cp -i' alias mv='mv -i' # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # 添加这行就可以了 PS1='[\[\e[00;35m\]\u@dev \t\[\e[0m\]]\[\e[0;33m\](\w)\$\[\e[0m\] '
[root@VM_72_235_centos ~]# source .bashrc (执行这句设置生效,只对当前用户生效) [root@dev 22:36:51](~)# ls (发现生效了)
rem 这里写你的仓库路径 set REPOSITORY_PATH=D:\Java\maven-repository rem 正在搜索... for /f "delims=" %%i in ('dir /b /s "%REPOSITORY_PATH%\*lastUpdated*"') do ( echo %%i del /s /q "%%i" ) rem 搜索完毕 pause