In general, it makes little difference whether a class is running under the PCA/JVM or a standalone JVM. You can use boolean logic to verify whether the class is loaded via the Sybase ContextClassLoader. For example:
boolean running_in_ase = false; running_in_ase = this.getClass().getClassLoader().getName().equals ("sybase.aseutils.ContextClassLoader");
if (running_in_ase) { //in ASE ... } else { //in a standalone JVM ... }