Java is one of the most powerful object oriented programing language which is widely used in very large scale enterprise applications. Java can be used in both standalone desktop applications or web based application (not necessarily applet). And in the mobile world also java is dominating as ANDROID. JAVA is highly scalable and can handle heavy loads and multi threads efficiently. PHP is a WEB scripting language (which also now support OOP) which is widely used in small and medium scale web based business applications and this helps the small and medium business sites to run with a very cheap hosting cost and very low development cost with quick development. Choosing Java vs PHP is really depends on the application to be created and it's scope. Both of these language are awesome and there is a great benefit and leaning both of these.
From my point of view, both PHP and Java are highly efficient and choosing amongst them is purely dependent on the type of project or application that has to be developed.
Then don't buy a Visual Studio license, write it yourself in Notepad++, or any other editor you might have available. You can write C#, VB, F# etc all you like without VS.