I'm making a simulator for Time Complexity. The purpose is that Students can choose which algorithms they want to compare.
But I want to make it possible to compare algorithms they've written themselves. I know how to get it to work with a compiled .class file.
I was wondering whether it is possible for the students to just paste the code (with predefined public methods) and then just run it.
I suppose that I have to do something with javac.
Any ideas are welcome!
Thanks
Once downloaded, install. in order to run Java from anywhere in your system, the files need to be added to your PATH variable in windows. To do this, go to 'Control Panel' -> 'System' -> the 'Advanced system settings' option on the left. Now under click 'environment variables' and then click edit on the PATH variable.
In Eclipse you can export you application via File -> Export -> Runnable JAR file Then you have to select the entry point (a class with a main-method) which should be called on running the jar-file. On the target computer you can normally run the jar file by double-clicking it (Java SE is required to be installed).
Use the JavaCompiler class. You will need to add tools.jar to your classpath if you don't already have it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With