First you have to rename the page with a .php extension instead of .htm or .html
PHP will not acknowledge the page unless it has a .php extension.
As far as Java, I am not sure how you would include it.
But if you mean Javascript, then it goes between <script></script> tags, generally placed in the <head></head> element of the document.
But can be placed any where in the <body></body> element depending on how it needs to be used.