How is the Android System running Java jars? There is a large amount of Java jars in /system/framework, for example, am.jar. I understand that Android uses Java in a very confusing way (at least for me). I do not completely understand the way that dalvik works.

Basically, I do not understand how Android runs these jars. Can somebody explain how it does this, and possibly how I can run my own jars?
I am on Resurrection Remix, 6.0.1, with Xposed framework, if it helps.

Thanks
You can run the Jar files using app_process, which replaces the java executable on Android. Looking at /system/bin/am for example, we see it's really running

exec app_process $base/bin com.android.commands.am.Am "$@"


You've mentioned running Xposed. If you'll google the manual installation of this framework, you'll see it both deploys a jar to /system/frameworks and replaces app_process with a modified one, where the hooks are added. It's also instructive to read through the modified app_process code.

Note you may need this answer to actually run your apps.

Finally, note that you seem to have misunderstood the link to stackoverflow answer in the comments (https://stackoverflow.com/q/30656933/2291). The Jars are installed. On newer systems, they are converted (and the files removed from the jar) to ART and run as native code (i.e. machine language). On older systems, I think the java class files are converted to Dex bytecode and run in the Dalvik VM. That means that the Dex bytecode is run in Dalvik in the same way Java bytecode is run by the Java VM on the fly. In any case, the JAR files always contain code initially.