1.Remove all the Java related packages (Sun, Oracle, OpenJDK, IcedTea plugins, GIJ):
2.Purge config files (careful. This command removed libsgutils2-2 and virtualbox config files too):
3.Remove Java config and cache directory:
4.Remove manually installed JVMs:
5.Remove Java entries, if there is still any, from the alternatives:
done
6.Search for possible remaining Java directories:
7.Install JAVA-8-SDK
8.Open
Try to run your ionic app again :)
Njoy!