Showing posts from March, 2015

Extract information from a java process that is running

Sometimes you need to obtain information regarding a JAVA process and the different options used to run this process such as the encoding, the timezone, the classpath, etc.Luckily there a tool bundled with the JDK that allows you to do so, you just need to provide it the PID of the concerned process; this can be done in different ways, personally I prefer to use another tool bundled with the JDK JPS however this might not work (in windows) for wrapped java applications such as tomcat service, so you can do it with the task manager or another toolOnce you have the PID is pretty straight-forward in its most basic form just provide the PID to the command line tool like so : jinfo 6544 You should get some output similar to this : Attaching to process ID 6544, please wait... Debugger attached successfully. Server compiler detected. JVM version is 25.20-b23 Java System Properties: java.vendor = Oracle Corporation catalina.base = C:\dev\servers\tomcat8 = HotSpot 6…

Edit tomcat service start-up options

There is an easy way to change a Tomcat configured as a service start-up options and configurations such as : Memory options (xmx, xms, etc.)Logging configurationMiscellaneous Java configurationThis can be done through the tomcat binary.1.-Head up to your tomcat's binary folder cd C:\dev\servers\tomcat8\bin> 2.- Launch the "Apache tomcat properties" window tomcat8w.exe //ES//MyServiceName Where MyServiceName is the name of the service you configured when installing tomcat as a service. This should open the following popup window : 3.- Edit your required properties Edit the properties; save the configuration and start/restart the service and you are done