Like most (all?) Nifflas games, Knytt Underground was made with Multimedia Fusion 2 and then 'exported' to C++ with the Chowdren framework. Python is the language used for scripting (i.e. to program quests and game events).
I assume when you say Java you're referring to the Java Editor: it's not an official editor and has nothing to do with the game. Otherwise, I know in Multimedia Fusion 2 you can export to Java as well, but I don't know much about it.