Skip to content

Instantly share code, notes, and snippets.

@sammso
Last active October 23, 2017 11:44
Show Gist options
  • Save sammso/088c1fd5d4beeb712be4bbed98950782 to your computer and use it in GitHub Desktop.
Save sammso/088c1fd5d4beeb712be4bbed98950782 to your computer and use it in GitHub Desktop.

create JDK

With 7Zip unzip the jdk-u..exe to some directory from there you find .rsrc\1033\JAVA_CAB10\111\tools.zip file. Unzip that file to some folder like <tomcat-home>\winjdk. Goto this <tomcat-home>\winjdk folder and run for /R %f in (.\*.pack) do @"%cd%\bin\unpack200" -r -v -l "" "%f" "%~pf%~nf.jar"

Original instruction.

https://www.whitebyte.info/programming/java/how-to-install-a-portable-jdk-in-windows-without-admin-rights

setenv.bat

Modify setenv.bat to use tomcat specific JDK.

if exist "%CATALINA_HOME%/winjdk/bin" (
	if not "%JAVA_HOME%" == "" (
		set JAVA_HOME=
	)

	set "JRE_HOME=%CATALINA_HOME%\winjdk"
)

set "CATALINA_OPTS=%CATALINA_OPTS% -Dfile.encoding=UTF8"
set "CATALINA_OPTS=%CATALINA_OPTS% -Djava.net.preferIPv4Stack=true"
set "CATALINA_OPTS=%CATALINA_OPTS% -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false"
set "CATALINA_OPTS=%CATALINA_OPTS% -Duser.timezone=GMT"
set "CATALINA_OPTS=%CATALINA_OPTS% -Xmx2g"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment