I have class called org.jbpm.task.Comment in my jbpm.jar.
However, this it’s a CR1 version and there is a bug in the class that I would like my application to overwrite.
Is it fine just to have a class in my project under com.jbpm.task called Comment and everywhere even in other jars it will refer to mine?
JAR files are just ZIP files. Use a tool like WinZip to extract all the files from the JAR, replace the .class file with yours, recreate the ZIP file using e.g. WinZip, rename it to .jar, overwrite the original JAR file.
If you don’t have the original source to the .class file you need to correct, then use a Java decompiler to produce .java source for the class. It will lack comments etc present in the original, but it will be sufficient to correct errors (e.g. incorrect null checking, as I had a few times in some products.)