When you use Oracle Java the Java programs are not compiled to native machine code which can immediately be executed by the CPU, but to an intermediate form called "java byte code".
The Java environment which executes this java byte code include a sophisticated compiler which can generate very good native machine code as it keep track of what the program actually do, and where it makes good sense to spend a lot of effort optimizing the machine code. Unfortunately all this bookkeeping takes up memory and the compiler itself also does, along with the rest of the Java environment. Also the garbage collection mechanisms cleaning up unneeded objects also needs additional memory to work well (i.e. fast).
All this result in Java programs needing a lot of memory even for small programs.