In Progress

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

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;

}

}

Skills: J2EE, Java, JSP, Software Architecture, webMethods

See more: dynamically compile run java code, world code no, string i, string b, runcode, jsp service, how to string, how to program a website in java, editing service com, code 8 com, code 8, base code, dynamically compile java code, what is json, webservice, web service in java, Return, Java web service, java json, java console, java code, java 8, heroku, compile, java code example

About the Employer:
( 25 reviews ) FOREST HILLS, United States

Project ID: #2575053

Awarded to:

javierdurante

Hello, I could easily do this for you in a day. PM sent

$50 USD in 1 day
(3 Reviews)
3.2

3 freelancers are bidding on average $58 for this job

swteam4

Hello, we are experts in Java programming and can help you with this task. Kindly check PMB.

$75 USD in 3 days
(18 Reviews)
4.4
Garettdv

Hi, I can do this project. Check PM.

$50 USD in 2 days
(2 Reviews)
0.9