Click here to Skip to main content
15,891,851 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I'm trying to make an online compiler for java using ASP.NET C#


C#
Process p=new Process();
p.StartInfo.FileName = "C:\\Program files\\Java\\bin\\javac.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.Arguments = "C:\\Hello.java";
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.CreateNoWindow = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
p.StandardOutput.ReadToEnd();
p.WaitForExit();


I run javac.exe to compile Hello.java, but the process isn't allowed by ASP.NET to write Hello.class to disk

But on doing it manually through cmd.exe without using ASP.NET or progmatically using C# only it runs perfectly

Can you help me make an online java compiler using ASP.NET or PHP?
Posted
Updated 25-Jan-12 22:27pm
v3

Try this:

What are Online Compilers & Online IDEs?[^]

hope it helps :)
 
Share this answer
 
Comments
Tech Code Freak 27-Jan-12 1:10am    
5!
Your web application runs with restricted credentials, so you can't perform file writes and such things without first giving your web user elevated credentials. That is not a good idea, but sometimes necessary.
Uday's answer provides you with some very good information on the subject.
 
Share this answer
 
Comments
Tech Code Freak 27-Jan-12 1:10am    
5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900