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 9239761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:03:45+00:00 2026-06-18T08:03:45+00:00

Can I call a Java program from a Node.js application on Heroku? I have

  • 0

Can I call a Java program from a Node.js application on Heroku?

I have a Node.js/Heroku app. But now need to add server-side capability to run an algorithm on an input data file and output data to a JSON format. I already have a Java library that can read the file and run the algorithm, and it would be very difficult (at best) for me to re-write it in pure Node.js.

So, could write a command line program, that takes an input file and pipes the results to stdout, e.g.

java mytask.class -cp ./mylibrary.jar --in /tmp/file.in > output.json

Is it possible to shell out a call to a Java command line program from Node.js? I know one can deploy Java applications to Heroku, but here want to execute a bit of Java from a Node.js app.

  • 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-06-18T08:03:45+00:00Added an answer on June 18, 2026 at 8:03 am

    Don’t you want this and child_process.exec() in particular ?

    Node provides a tri-directional popen(3) facility through the
    child_process module.

    It is possible to stream data through a child’s stdin, stdout, and
    stderr in a fully non-blocking way.

    Note that your example command above isn’t right, since you’re trying to pipe to a file (output.json). Pipes only work between processes. The child process module would allow you to read the processes’ stdout directly and you wouldn’t need the file (similarly for the input stream)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to call some methods in Wininet.dll from a Java program. I can
I need to call some PL/SQL procedures from my Java application. I can do
(Yes I know I can call Java code from Scala; but that is pointless;
I have a program that needs to process data from Standard-In. I can call
I am trying to call native executables from java program. I have three exe
In my project, I call java program from the command window. I have a
How can I call HttpServletReponse from JBPM execution context. This is because delegated java
How can I call a web service method from java desktop client. Basically my
I have a C++ library that I call from Java via JNI. There's a
I don't know why, but I can't call the method paint(Graphics g) from code.

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.