Oracle has recently announced a significant change to their licensing policies for Oracle Java SE deployments. This change could make your Oracle Java SE license exposure..
In APEX 4.2, I would debug JavaScript code using the alert() function. I would use this to show information about variables and the steps taken through code.