This is exciting. But wouldn't this result in very large final binary sizes?
This can happen even in languages like C when you do static linking.
The solution is to have the linker remove all code that is not being called. The consequence of it, it that you are restricted in doing reflection, for example.
Some Java native compilers allow you to provide a list of methods to leave alone, to avoid them being removed from the final executable.
Although, from my experience doing Android with Scala, the process is slow.