I do not know what a practical way to do this.
In theory, a bytecode interpreter could be implemented with completely deterministic behavior under certain assumptions 1 . You will need to simulate multiple threads, implementing threads and thread scheduling entirely in software and using one proprietary thread.
1 - For example, there is no I / O and the system clock is not used.
source share