you have to add vm argument while running the program. This should be like
-Dwebdriver.firefox.bin=/custom/path/of/firefox/exe
In IntelliJ IDE much simpler Goto Run ? Edit Configurations... In VM options add the above.
Eclipse also have the options to give vm argument while running. This way I am using portable Firefox with selenium.