Please give more information , so we can help..
like if they are diff apps with diff lang and the type of hosting you have , and the need beyond this .....
You can use Java And PHP on the same server. GoDaddy allows you to do that.
A similar question on stack overflow:
http://stackoverflow.com/questions/2128619/run-java-class-file-from-php-script-on-a-website