- Start tomcat server with remote debug enabled with JVM parameters: -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y and make sure you setting suspend=y to let the tomcat server suspend and wait for debugger to attach to it.
- Start your debugger, I am using Intellij Remote Debug, and here is the settings: Host: localhost Port: 8000
Showing posts with label java. Show all posts
Showing posts with label java. Show all posts
Saturday, April 10, 2010
How to remote debug Tomcat server code?
Either you are a developer of Tomcat or you would like to see how the Tomcat works in a live mode, you may want to set a few break points in the Tomcat codes and to see the code in the live run. How could you set up remote debug for tomcat? Thanks for the JPDA(Java Platform Debug Architecutre) we can easily achieve this goal.
Wednesday, December 9, 2009
Unable to access jarfile on Cygwin
Today I ran into a strange problem on Cygwin: I give the full path to the jar file for the java command, but strangely, the java runtime shows me the error message: Unable to access jarfile /cygdrive/c/pathtojar/.yuicompressor.jar. What is going on? did I have a typo? No. Then Why? After scratch my head enough, I figure out that the java in Cygwin does not like Unix format path to specify the jar file. You can use cygpath to do the trick to convert the Unix format path to mixed(-m) or windows format(-w) path, the java command will happily take it and use the jar file. Here are the two commands that works for me:
- java -jar `cygpath -m /cygdrive/c/pathtojar/.yuicompressor.jar`
- java -jar `cygpath -w /cygdrive/c/pathtojar/.yuicompressor.jar`
Wednesday, May 2, 2007
Set the JVM platform default character encoding to UTF-8
You could set the JVM platform defalult character encoding to UTF-8 by using the following JVM option:
-Dfile.encoding=UTF-8
Make sure this flag come before your Main program name, especially when you are calling org.apache.tools.ant.Main.
Please refer here.
-Dfile.encoding=UTF-8
Make sure this flag come before your Main program name, especially when you are calling org.apache.tools.ant.Main.
Please refer here.
Monday, April 9, 2007
IntelliJ supports UTF-8?
One of my colleague complained that the IntelliJ does not support UTF-8 correctly:
- System.out.println("Dealer Caterpillar ciężkiego używanego wyposażenia i używanych części"); when you run it, the special character corrupted.
- After you safe the java file, restart the Intellij, the special character corrupted.
Tuesday, October 3, 2006
How to default java to -server
You can change <InstallationDir>/jre/lib/jvm.cfg (the default installation on Solaris would be /usr/j2se) to have -server as the first uncommented line in the file. This will cause -server to be used as the default.
Frequently Asked Questions About the Java HotSpot VM
technorati tags:JVM
Subscribe to:
Posts (Atom)