Java code Security check mechanism :
First, the class loader is responsible for loading the class file (. class file) into the Java Virtual machine (JVM), which adds security by distinguishing between classes on the local file system and classes imported by the network system. This can limit any Trojan horse program. Because the native class is always loaded first, once all the classes are loaded, the memory of the execution file is fixed.
The bytecode Checker then verifies that the bytecode verifier does not check the class files generated by the trusted compilers, but instead examines the class files that intentionally violate the namespace rules and Java language rules, and closes the class file with a security vulnerability. Self Code checker mainly performs the following checks.
The loaded class conforms to the JVM specification's class file format, does not violate the access restrictions, does not cause overflow or underflow on the code, the parameter types of all operation codes are correct, no illegal data type conversions occur, and checks for the existence of certain illegal operations on the class file. The bytecode checker executes a sequence of try-catch-finally statements in a Java source program and captures and responds to Java program errors.
Finally, if the bytecode check is passed, the Java interpreter is responsible for interpreting the class file as machine code for execution.
Check mechanism for Java code security