下面是安装JDK的测试结果,
install jdk test1.... INSTALLDIR -------------------------------------- start /w \VBOXSVR ools oolsjdk-6u45-windows-x64.exe /L d: oolJavainstalljava1.log /s ADDLOCAL="ToolsFeature,SourceFeature,PublicjreFeature" INSTALLDIR=D: oolJavajdk1.6.0_45 WEB_JAVA=0 AUTO_UPDATE=0 ----> jdk Location: D: oolJavajdk1.6.0_45 jre Location: C:Program FilesJavajre6 此时指定了installdir, 那么jdk就会安装到指定目录:D: oolJavajdk1.6.0_45 没有指定public jre安装目录,系统会自动安装到 C:Program FilesJavajre6 ------------------------------------------------------------------------------
install jre test2.... INSTALLDIRPUBJRE ----------------------------------- start /w \VBOXSVR ools oolsjdk-6u45-windows-x64.exe /L d: oolJavainstalljava2.log /s ADDLOCAL="ToolsFeature,SourceFeature,PublicjreFeature" /INSTALLDIRPUBJRE=D: oolJavajre6 WEB_JAVA=0 AUTO_UPDATE=0 --------> jre location: D: oolJavajre6 ---对应程序为 java(TM) update 45 jdk location: C:Program FilesJavajdk1.6.0_45 --对应程序为 Java(TM) SE Development Kit 6 Update 45 (64-bit) 此时通过/installdirpubjre指定了public jre的安装目录,那么public jre就会安装到指定的目录: D: oolJavajre6 jdk没有指定,就会安装到默认的 C:Program FilesJavajdk1.6.0_45
------------------------------------------------------- install jdk test3.... INSTALLDIR INSTALLDIRPUBJRE ---------------------------------- start /w \VBOXSVR ools oolsjdk-6u45-windows-x64.exe /L d: oolJavainstalljava3.log /s ADDLOCAL="ToolsFeature,SourceFeature,PublicjreFeature" INSTALLDIR=D: oolJavajdk1.6.0_45x64 /INSTALLDIRPUBJRE=D: oolJavajre6 WEB_JAVA=0 AUTO_UPDATE=0 --------> jdk location: D: oolJavajdk1.6.0_45x64 jre not install 同时指定了jdk 安装目录,pubjre安装目录,系统自动安装jdk到指定位置,没有安装public jre, ------------------------------------------------------------------------------ install jdk test4.... ADDLOCAL /INSTALLDIRPUBJRE="" ---------------------------------- start /w \VBOXSVR ools oolsjdk-6u45-windows-x64.exe /L "d: oolJavainstalljava4.log" /s ADDLOCAL="ToolsFeature,SourceFeature,PublicjreFeature" INSTALLDIR=D: oolJavajdk1.6.0_45x64 /INSTALLDIRPUBJRE="D: oolJavajre6_x64" WEB_JAVA=0 AUTO_UPDATE=0 --------> jdk location: D: oolJavajdk1.6.0_45x64 jre not install 与test3的区别,在于/installdirpubjre=""后面添加了引号,结果和test3一样。 ------------------------------------------------------------------------------ install x86 test5..... ---------------------------------- start /w \VBOXSVR ools框架jdk-6u45-windows-i586.exe /L "d: oolJavainstalljava5.log" /s ADDLOCAL="ToolsFeature,SourceFeature,PublicjreFeature" INSTALLDIR="D: oolJavajdk1.6.0_45_x32" /INSTALLDIRPUBJRE="D: oolJavajre6_x32" WEB_JAVA=0 AUTO_UPDATE=0 --------> 出现windows installer提示 jdk location: C:Program Files (x86)Javajdk1.6.0_45 jre 没有安装 与test4的区别,install=""添加了引号,结果jdk安装位置 C:Program Files (x86)Javajdk1.6.0_45, public jre的安装目录 ------------------------------------------------------------------------------ install x86 test6.... ----------------------------------- start /w \VBOXSVR ools框架jdk-6u45-windows-i586.exe /L "d: oolJavainstalljava6.log" /s ADDLOCAL="ToolsFeature,SourceFeature,PublicjreFeature" INSTALLDIR="D: oolJavajdk1.6.0_45_x32" /INSTALLDIRPUBJRE="D: oolJavajre6_x32" --------> 出现windows installer提示 jdk location: C:Program Files (x86)Javajdk1.6.0_45 jre 没有安装 系统指定jdk_x32的安装,jdk的安装目录为C:Program Files (x86)Javajdk1.6.0_45 ------------------------------------------------------------------------------ install x64 test7... ----------------------------------- start /w \VBOXSVR ools oolsjdk-6u45-windows-x64.exe /L "d: oolJavainstalljava7.log" /s ADDLOCAL="ToolsFeature,SourceFeature,PublicjreFeature" INSTALLDIR="D: oolJavajdk1.6.0_45_x64" /INSTALLDIRPUBJRE="D: oolJavajre6_x64" WEB_JAVA=0 AUTO_UPDATE=0 --------> jdk location: C:Program FilesJavajdk1.6.0_45 jre 没有安装 jdk_x32安装,installdirpubjre="",在引号前加了一个, 但是jdk 的安装目录为 C:Program FilesJavajdk1.6.0_45
------------------------------------------------------------------------------ install ADDLOCAL /INSTALLDIRPUBJRE="" test8..... ---------------------------------- start /w \VBOXSVR ools oolsjdk-6u45-windows-x64.exe /L "d: oolJavainstalljava8.log" /s ADDLOCAL="ToolsFeature,SourceFeature,PublicjreFeature" INSTALLDIR=D: oolJavajdk1.6.0_45x64 /INSTALLDIRPUBJRE="D: oolJavajre6_x64" WEB_JAVA=0 AUTO_UPDATE=0 --------> jdk location: D: oolJavajdk1.6.0_45x64 jre location: D: oolJavajre6_x64 jdk_x64安装,注意参数installdir=d:... /installdirpubjre="d:..." 此时jdk和jre的安装确实是 参数指定的。 所以说,jdk的安装目录指定使用installdir=d:..., 不能加引号 /installdirpubjre="d:...", public jre的安装需要引号,确在前面加上反斜杠.