The invention provides a JAVA program anti-obfuscation method and a terminal. According to a first index and a preset second index set, a package name, a class name, an interface name and member variables are renamed to obtain a first JAVA program, execution information when a Java virtual machine executes a bytecode is recorded through OpenJDK, the uncalled member variables of the first JAVA program and a function are deleted to obtain a second JAVA program, according to a statement execution process in the execution information, the unexecuted statemenTS in the second JAVA program are deleted to obtain an optimized JAVA program. According to the method, the problem is solved that in the original confused Jar package, the package name, class name, method in the JAVA program are replaced with meaningless names, much confusion can be produced when the meaningless names are viewed in reverse analysis, resulting in that the reverse analysis process is very time-consuming.