Virtual and remote laboratories that are commonly used in engineering education are mainly designed using Java programming language. The most popular and widely used learning management system is Moodle. This paper describes the development of a virtual laboratory using Easy Java Simulations software tool and its integration with e-learning tool Moodle. The virtual laboratory demonstrates how Easy Java Simulations and Moodle are used in optimal control theory education by the example of the well-known brachistochrone problem solution.