• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Online Java Compiler Gadget/Widget for my website

 
Madangopal Venkatesan
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,


I need to add an "Online Java Compiler" feature to my website. Are there any widgets/gadgets available to add on my site to enable this feature?
 
Tim Moores
Bartender
Posts: 2895
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I doubt it, since that's a really specialized feature. You'll most likely need to create your own.
 
Madangopal Venkatesan
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I go about it? I have no clue where to start! I'm building this site using Google Sites. So, even if I did write a gadget/widget, I would have to write it the Google way to embed on my site.
 
Tim Moores
Bartender
Posts: 2895
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isn't Google Sites just hosting of static content with no active server-side components? That's what you'd need here - something like servlets or PHP.
 
Madangopal Venkatesan
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's only static content. But I can add google widgets which enable dynamic nature! I've integrated Docs on my site. News can be integrated and lots of other stuff. Most of them read from Feeds. For this feature requirement I have, I have no clue what I need to do!

Correct me if I'm wrong - Here, I might have to have a text area and a "Submit Code" button. On submitting, I need to invoke a servlet/php and parse the contents and execute it. I will then have to dump the results as a stream. Is this the approach?
 
Tim Moores
Bartender
Posts: 2895
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's the basic approach, but the difficulty is in the "invoke a servlet/php" - which is something I don't think is possible using Google Sites; it would somehow have to invoke your stuff that's running elsewhere. But I'm no Google Sites expert, so take that with a grain of salt.
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can invoke a Java compiler from within Java.

http://docs.oracle.com/javase/6/docs/api/javax/tools/package-summary.html

WP
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William P O'Sullivan wrote:You can invoke a Java compiler from within Java.

Online?
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Daryl

If he has a compliant servlet engine, I don't see why not.

simply upload the file, convert to a String (as in the Oracle) example, invoke the compiler, and run it.

Now. I have no idea, how input and output would be handled, and I have not done this.

Just saying, with a smart architecture it should in theory be possible.

WP
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic