Since many official mobile stores for older handsets have closed, you can find .jar archives on community-driven platforms: – A massive library of legacy Java games.
For simplicity, let's create a basic Java game using Java's Swing library for graphics and user interface. This example will create a window of size 320x240 and bounce a rectangle around the screen. java game jar 320x240 link