Page 1 of 2 12 LastLast
Results 1 to 20 of 24
Like Tree1Likes

Thread: Online Java compiler

  1. #1
    PhoeniX is offline Member
    Join Date
    May 2008
    Posts
    4
    Rep Power
    0

    Default Online Java compiler

    i have a class project:
    to create an online java compiler/runner where users can write, compile and execute code...
    to start, i think i have to put the compiler on the server, with the jdk of course... but i have doubts as for the interface of the application or the website... and its functionality... what if a user is implementing GUIs... how to manage the output then...

    Please, anyone who's interested in giving me tips about this project or any ideas is more than welcome!!

    Regards!
    rupa2002 likes this.

  2. #2
    Zosden's Avatar
    Zosden is offline Senior Member
    Join Date
    Apr 2008
    Posts
    384
    Rep Power
    7

    Default

    you could just have the user send their files to a server then send back the compiled classes. Then just have the user run the compiled classes.
    My IP address is 127.0.0.1

  3. #3
    PhoeniX is offline Member
    Join Date
    May 2008
    Posts
    4
    Rep Power
    0

    Default

    I wanted it to be interactive... so the users write their code... check it for mistakes... then compile it and run it!!!
    It's like a complete JAVA IDE but online!!!!

    So????

  4. #4
    Zosden's Avatar
    Zosden is offline Senior Member
    Join Date
    Apr 2008
    Posts
    384
    Rep Power
    7

    Default

    I don't think that is possible unless you send back a jar file then have the users run it. If you want an IDE you would have to come up with a way to read the text and check for mistakes and everything else that goes into making an IDE. This is a lot more complicated than you think. Eclipse was a multi-million dollar project worked on by a team of computer scientist. Just keep that in mind.
    My IP address is 127.0.0.1

  5. #5
    rjuyal's Avatar
    rjuyal is offline Senior Member
    Join Date
    Mar 2008
    Location
    Delhi, India
    Posts
    194
    Rep Power
    7

    Default

    you are trying to create online Eclipse :eek:
    i am the future

  6. #6
    PhoeniX is offline Member
    Join Date
    May 2008
    Posts
    4
    Rep Power
    0

    Default

    Ok guys... thx :P
    I'll do my best!!

  7. #7
    danielstoner's Avatar
    danielstoner is offline Senior Member
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    191
    Rep Power
    7

    Default

    Just a suggestion:

    The Java compiler has a public API. It is also integrated with the Java Scripting Engine API. You can read here: Little Tutorials about it. Maybe somehow scripting the compiler can help you achieve the things you want, at least a start. If you want to learn more about scripting a Java application you can read my latest tutorial at: Script Thy Java App | Little Tutorials

    In running this kind of application online you have to consider the security implications.

    Good luck
    Daniel @ [www.littletutorials.com]
    Language is froth on the surface of thought

  8. #8
    PhoeniX is offline Member
    Join Date
    May 2008
    Posts
    4
    Rep Power
    0

    Default

    Yeah ... that was one of my main concerns.... runnable code online :S:S
    but i'll have to try it... hehe
    thx anyway... i'll be checking ur tutorials now :P

  9. #9
    grape028 is offline Member
    Join Date
    Dec 2008
    Posts
    2
    Rep Power
    0

    Default

    How is the progress of the project?

  10. #10
    anandpr89 is offline Member
    Join Date
    Oct 2009
    Posts
    3
    Rep Power
    0

    Post

    I'm a final year btech student.I'm planning to do this as my final year project.So, can u help me by telling me the basic idea..and the method for implementing such a compiler?

  11. #11
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    Location
    San Jose, CA, USA
    Posts
    320
    Rep Power
    6

    Default

    That would be a cool google wave extension: Google Wave Extension

    =)
    My Hobby Project: LegacyClone

  12. #12
    Join Date
    Jul 2010
    Posts
    1
    Rep Power
    0

    Default

    I,m final year studend BE (IT) I choose online compiler as my project.please can u teel me how online java compilers works at server side ,when any users wants to compile their programs ..ur help give the idea about it & this will help me to making class diag,activity diag. thanks

  13. #13
    anandpr89 is offline Member
    Join Date
    Oct 2009
    Posts
    3
    Rep Power
    0

    Default

    Hey, i had done this as my project. The idea was to save the code and to compile it using the system calls.

  14. #14
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,519
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by anandpr89 View Post
    Hey, i had done this as my project. The idea was to save the code and to compile it using the system calls.
    System calls? What system calls? As far as I know there are no system calls that compile Java source code ...

    kind regards,

    Jos

  15. #15
    anandpr89 is offline Member
    Join Date
    Oct 2009
    Posts
    3
    Rep Power
    0

    Default

    we did only for c, c++. but i think it will work for java too. In a Linux server, we can compile the code using the calls like
    $command=$path_compiler.' -c "'.$compile_file.'" -o "'.$compile_file.'.o" 2>> "'.$result_file.'"';
    system($command, $retval);

    This is the thing we used. system calls within php.

  16. #16
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,519
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by anandpr89 View Post
    we did only for c, c++. but i think it will work for java too. In a Linux server, we can compile the code using the calls like
    $command=$path_compiler.' -c "'.$compile_file.'" -o "'.$compile_file.'.o" 2>> "'.$result_file.'"';
    system($command, $retval);

    This is the thing we used. system calls within php.
    Ah, yes, you're simply invoking the compiler from a shell/command line interpreter but that doesn't solve the 'remote compilation' task stated in this thread. b.t.w. the API for the javac compiler is public so there's no need to have a shell running in between your application and the compiler.

    kind regards,

    Jos

  17. #17
    pabletec is offline Member
    Join Date
    Jan 2011
    Posts
    1
    Rep Power
    0

    Default

    There is a good online java compiler and runner here. You can also run threads and see the results immediately. http://www.browxy.com

  18. #18
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default

    Well, doesn't seem that difficult. You're not actually required to convert the java into bytecode yourself right? You can use the official javac?

    Groovy on Grails is the way to go. Its a complete MVC web app system that allows the execution of actual java code. You can make calls to a server side instance of javac and provide links to download the compiled binaries, or execute the binary and return the results of the output to the user via formatted GSP (groovy server pages). Bonus, you stay 100% in the JVM. Jetty is a great lightweight application server for Grails apps too. Good luck!

  19. #19
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,519
    Blog Entries
    7
    Rep Power
    20

    Default

    I wonder how those online compilers work: suppose I have a class A that depends on a class B that depends on a class C. I compile them all (upload the stuff and compile it). Later I change one thing to class A. I think I have to upload the sources for class B and C again if I want to (re)compile the code for class A. I don't think that online compiler keeps a repository of compiled code for me; nah ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  20. #20
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default

    I don't think that online compiler keeps a repository of compiled code for me; nah ...
    Yeah probably not. I imagine you need to upload the entire state of a code base for it to work, the same as a local solution.

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 2
    Last Post: 04-28-2008, 10:56 AM
  2. Java experts needed- 30 minute online Java projects
    By michelle in forum Jobs Offered
    Replies: 0
    Last Post: 03-05-2008, 11:47 PM
  3. Refer a good Java compiler
    By trill in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 07:31 AM
  4. The best compiler for java
    By baltimore in forum New To Java
    Replies: 2
    Last Post: 08-06-2007, 05:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •