Star by clarifying with your instructor if you need to use a "Java GUI" or a "JavaScript". Two very different things in spite of the fact that they both contain the word "Java".
If you really meant "Java GUI" then you first step will be to write a Java Applet. You will then use a bit of HTML to download and execute the applet in your browser. No PHP so far.
When your applet needs to interact with the server it will do so by executing an http request. The request will contain the name of the php script to execute on the server along with any additional data. The server will run your php script and pass any results back to your java applet.
But using java applets is rare. I'm willing to bet your assignment is really to use JavaScript for the client side.