Refactored background run to enable passing javaOptions as an argument