shalinee wrote:
Hi,
I have couple of java Jobs developed by somebody else with source code and now I need to modify them to add some new requirement or debug it. I just look in the[b] lib folder in Clarity application server and there I found a jar file which is having the details of all the java codes. I have couple of questions here.
1- We are planning to move from CA V12.04 to V13.1 very soon then during or after upgrade do I need to compile the custom jar file? Is there any additional steps require to take care the custom java codes other then the backup of custom files?
2- What all are the per-requisite to view custom java jobs code. Can somebody explain the steps like What is the tool require to open this file on my local machine (example eclipse etc). , How to set the class path etc.
Any help/suggestion will be appreciated
Thanks,
This sounds like a task that should be carried out by a java programmer; I'm making an assumption from these questions that you are not one currently.
Although there are some java decompilers out there to reverse engineer the byte code .class files back to .java source, you really need access to (and the permission) to the true source .java files, especially if asking these questions, as any reverse engineering would lose the original structure (somewhat) of that source as the compiler rewrites the code (optimizes), the naming of all variables and constants will get replaced with generic tags, and all of the source code comments, all adding up to a significant reduction in source code readability. If you have the source, then you don't really need anything that is compiled/deployed to the Clarity server currently.
To open .java files on your local machine you could use any text editor. Eclipse is a fine IDE for .java source, but a bit overkill for what most Clarity jobs should be looking to do. It can also help with debugging the running of a job inside Clarity, but needs the original source files and for the .class files to have been built with the debug symbols included ("javac.exe -help" and look at the first parameters on debugging "-g", if the source was compiled with "-g:none" then the binaries aren't much use for live debugging).
Setting the class path is a JVM argument needed at compile and run time, i.e. when running the javac.exe and java.exe commands to build and run your code. Have a look in the xog.bat file for example and see the call to java.exe in there with the "-cp <path>" jvm parameter, that's the classpath for that jvm alone, and that is how it is set. For running a background job in Clarity that's not needed though (Clarity services scavenge for the files it finds in the /lib directory at startup for its class path), so you'll just want it for compiling in your case, and perhaps running any out-of-Clarity unit test runs.