Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Executing a remote program from/to different platforms

  1. #1
    Junior Member
    Join Date
    Jan 2021
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Executing a remote program from/to different platforms

    Hi,

    Suppose I have an executable. This executable can be a Windows or a Linux program.
    The executable resides on a shared location.
    My Java code runs on either Windows or Linux and it supposed to be able to execute the above program.
    Meaning, my code can run on Windows and need to run an executable on Linux, and vice versa.
    I was told that I could use URI (instead of asking the user to provide the Windows and Linux representation of the path), I read about it but not sure it's what I need.
    Suppose the user provides the URI path, can it be used in ProcessBuilder? If I have a location on the network that is accessible from Linux and Windows servers, can the URI be one for both?
    Maybe there are other methods to accomplish this?

    Appreciate any idea you can share, thanks!

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Executing a remote program from/to different platforms

    This sounds like a problem with using an OS, not a java programming problem.

    If the program you want to execute is a server that can be connected to the internet, then a client on another computer could connect to it using sockets.
    If the remote computers have servers with special capabilities that allow you to ask them to execute a local program you could use that. Then you would need a client that could connect to that server and send it instructions about what you want done.

    This reminds me of RMI which is an older framework for working between computers connected to the internet.

    Try asking the question here: http://www.coderanch.com/forums
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. [SOLVED] Executing cmd from Java, Compiling and Executing IN Runtime
    By Andrew R in forum What's Wrong With My Code?
    Replies: 6
    Last Post: August 9th, 2013, 10:00 AM
  2. Program not executing correctly
    By daemonlies in forum What's Wrong With My Code?
    Replies: 6
    Last Post: May 1st, 2012, 11:14 PM
  3. Executing query from java program
    By ashu000 in forum JDBC & Databases
    Replies: 1
    Last Post: June 25th, 2011, 12:43 PM
  4. Executing a program on my computer with an ActionListener?
    By FoxBoiii in forum Java Theory & Questions
    Replies: 1
    Last Post: April 29th, 2011, 05:22 PM
  5. Help Executing C Program From Java! (Ubuntu)
    By penguinGirl in forum What's Wrong With My Code?
    Replies: 0
    Last Post: April 18th, 2010, 01:47 PM