Out of the box - no - you cannot do this via the JCR API. However.... with AEM - there is most often a custom way. This is no exception.
You can write an AEM workflow that does that job. Then you can invoke the Workflow via an API. See:
http://helpx.adobe.com/experience-manager/using/invoking-experience-manager-workflows-using.html
That is -- you can use the Workflow APIs to invoke a workflow. Now here is the cool part of working with AEM. You can code a custom Sling Servlet that uses the Workflow API to invoke the workflow that publishes the content.
Now using a Restful request from an external Java App - you can sent a GET Request to kick off the Sling Servlet. We have a community article that shows you how to invoke an AEM Servlet from an external Java app:
http://helpx.adobe.com/experience-manager/using/post_files.html
Notice that the Java app uses Apache org.apache.http APIs.