Completed

Dynamically Compile Java code from String and return output from webservice!

This project was successfully completed by javierdurante for $50 USD in a day.

Get free quotes for a project like this
Employer working
Completed by:
Project Budget
$50 - $100 USD
Completed In
1 day
Total Bids
3
Project Description

Requirements: Sandbox solution to compile and run java code from students. The solution should have an option to limit harmful functions like deleting files, accessing network, or endless loops. It needs to be running on separate JVM since we do not want students to crash the system intentionally or unintentionally. Input string will be coming from interface similar to this website [url removed, login to view] . I believe this uses [url removed, login to view] for code editing.

Environment: The program can be developed in any way you like but must be deployed on Heroku platform. Only this way I can assure that program is working correctly. It should be able to call Webservice from any other platform.

Input: String of Java code from a web service. It could be snippets (or) entire java class as a string.
Output: Return compiler message as a string when the compilation fails: return (0, compiler_err_msg). If there is no compile error and program runs successfully: return(1, return_value). Return value could be integer, string, base on how the original code as defined. Prefer to return data as Json.

Example code:

// returns what was printed on the console
class HelloWorld {
public static void main(String[] args)
{
[url removed, login to view]("Hello World!");
[url removed, login to view](sum(2,3));
}
public static int sum(int a, int b)
{
return a + b;
}
}


// returns integer
class HelloWorld {
public static void main(String[] args)
{
return multiply(10, 20);
}
public static int multiply(int a, int b)
{
return a * b;
}
}

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online