javaweb-servicesonline-compilation

how to build an online compiler without compiling code on my own server


Part of my final project needs to build a online compiler which can be accessed by everyone. I've implemented the editor part, the main problem is in the compiler part. First I thought I can compile code on university's server, and I asked IT support of my university for help. They refused for security risk (of course).

So, I can't compile code myself.

Then I am thinking of embed a online ide in my website. But service of ideone.com is not free now and I will only run this website for at most 3 weeks, and unfortunately, ideone.com is the only online compiler I know, which provides its API and service.

So, what should I do now?

  1. buy service from ideone.com

  2. buy a vps service maybe? But I am not sure if they allow me to compile arbitrary java program.

  3. ide.com says: "If you represent an educational organization or a small startup initiative (not supported by any company), we are happy to offer you a free MINI package". Or maybe I should try to apply for a mini package? Although I've got no idea what is "mini package".

  4. or if you have any other idea, please tell me!!!

Thanks.


Solution

  • 2) buy a vps service maybe? But I am not sure if they allow me to compile arbitrary java program

    If you buy a VPS or dedicated server, you can usually do whatever you want. But then you're laying yourself open to the same security risks that your university IT department refused to take: If the program does something malicious, and you compile and run it in your VPS/dedicated server, it can do something malicious in your dedicated server.

    You can mitigate that a bit by compiling and running the code within your own SecurityManager implementation (more in this question and its answers), which can prevent (for instance) arbitrary file access, network access, etc.