Question:
Building Java/C++ Tutorial app, can I add compiler?
Leah
2013-10-22 05:15:53 UTC
I'm building an app for college and I was wondering if there is any open source to allow me to compile Java/C++ code in the app?
Similar to w3schools "Tryit Editor"

Havent a clue where I should start or if it can be done, building the app using phonegap

Thanks for the help
Three answers:
who am I?
2013-10-22 05:34:58 UTC
Well running a compiler in an app is overkill according to me. So, what you can do is send the code to a remote server and compile it there and resend the compilation errors/data to the client. That way the client does not have to compile any code which makes your app much faster to use.



I am really not clear as to what you mean by app. If its just a desktop application then there are many other ways but if its some mobile application then you probably want to do what i mentioned above.( I highly doubt that mobile applications have that many permissions).



For a desktop application, there are OS calls in every language, so just find the API and parse it to the OS terminal or you can write a shell script and execute it everytime you want to compile something.



The first example is what we see on websites like codechef.com, codingame.com and what not.
icefyre
2013-10-22 05:40:51 UTC
for c you can use GNU g . The GNU compiler suite also have a free Java compiler though for Java I'd just use the OpenJDK.



http://gcc.gnu.org/



and



http://openjdk.java.net/





for online compilation I'd use http://www.ideone.com

Hope this helps!
DocManhattan
2013-10-22 08:21:03 UTC
If you have your own computer, install Eclipse.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...