Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 568587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:12:15+00:00 2026-05-13T13:12:15+00:00

I have a website and want to be able to allow the user to

  • 0

I have a website and want to be able to allow the user to run a Java file on the server from the website.

I want the user to click a button which will run the Java file on the server AND anything printed to standard-out by the Java program will be printed out on the website for the user to see.

How can this be done (call Java program from PHP and feed the standard out from the Java file back to the PHP website in real time)?

Update:

Thanks for the answers on how to run the Java program from PHP. However I also want to be able, as the Java program is printing to stdout where it will be printing out a lot of text as it is executing, to be able to print this out on the webpage so that the user can see what stage the Java program is in its execution.

How can this be done and does it require any additional AJAX or JavaScript or anything like that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:12:16+00:00Added an answer on May 13, 2026 at 1:12 pm

    The PHP exec() function is the way to go, but you should be very careful in what you allow to executed.. in other words don’t rely on user input as it could potentially compromise your entire server.

    Calling the Java application launcher using exec, you can execute any Java application from PHP, e.g.

    <?php exec("java -jar file.jar arguments", $output); ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have website of application which sells applications online.on the home page i want
I want to allow a user of my web-app to be able to post
I have an application which receives data from a news website (through rss) and
I have a video file on a website in .MP4 format and I want
I have a website I want to regexp on, say http://www.ru.wikipedia.org/wiki/perl . The site
I have a website that I want to add Javascript to the header part
I have a website where i want my visitors to invite their friends. I'm
We have a website site.com and want to give faster access to that site
I have a website project that I want to build using CruiseControl.net. On one
I have this website I am designing and I want to make it to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.