What is hot code replace? – Ref: eclipse.org
Hot code replace (HCR) is a debugging technique whereby the Eclipse Java debugger transmits new class files over the debugging channel to another JVM. In the case of Eclipse development, this also applies to the VM that runs the runtime workbench. The idea is that you can start a debugging session on a given runtime workbench and change a Java file in your development workbench, and the debugger will replace the code in the receiving VM while it is running. No restart is required, hence the reference to "hot".
In our Windchill development environment setup, we are going to add eclipse project workspace into Windchill classpath. So when you will start eclipse method server debugging and in between debugging mode if you modify any class, the updated class code will get execute and most importantly without class compile or method server restart.
So we saved a lot time in sysouts, class compilation and method server restart
Add hot code replace in Windchill development environment setup:
- Take backup of
/codebase/wt.properties.xconfedit "wt.java.classpath" property value to add eclipse project workspace path. In the property value you need to add your eclipse project workspace bin folder path.
The updated property value will be like as below (
Property name="wt.java.classpath" multivalued="$(path.sep)" default="$(dir.sep)opt$(dir.sep)eclipseworkspace$(dir.sep)Windchill$(dir.sep)bin$(path.sep)$(wt.home)$(dir.sep)codebase$(path.sep)$LIB(wt.webinf.lib)$(path.sep) --- and original
- Run xconfmanager utility to propagate the xconf value
- Restart method server
- Works in eclipse debug mode only
- Make sure that Project -> Build Automatically is checked (enabled)
- Hot code replace works effectively for method level code changes but some time fails for class level changes like adding method/variable, imports, etc
Now start Windchill development without sysouts and method server restarts. So shift the development gear and go bhuuuummmmmmmm
To know more about hot code replace visit http://wiki.eclipse.org/FAQ_What_is_hot_code_replace%3F