1

I have a Java program which is divided into client and server code. However, for standalone users, I want both the server software and client software to be launch with the click of one button. I have had success embedding the http server with the server software. What I need now is a way to launch the two programs (as two instances) from a single place which can send information to the programs that it has spawned. How can I achieve this?

P.S. I have used JavaFX for the client program so it is better if I have a way of launching JavaFX programs as well.

4
  • 3
    How about a batch file or shell script launching the server and client? Commented Oct 5, 2014 at 9:09
  • It's a good idea but I would also like to create a platform independent installer as well. Commented Oct 5, 2014 at 9:15
  • 2
    In order to make it platform independent you could include both start.bat and start.sh in your project's "bin" directory. This is how a lot of projects do it (e.g tomcat). Regarding the installer, do you really need it? Java apps with included jar dependencies are pretty much portable. Commented Oct 5, 2014 at 9:19
  • I seem to need it for marketing reasons in my country. People seem to have more trust for software which is installable than one which is not. Commented Oct 5, 2014 at 9:23

1 Answer 1

1

Can always make a Java program that launches two Process obecjts after building the environment (classpath, correct java home etc taking in to account environment and OS). There should be reusable code in java based installers but you would have to comb thru them for what you need.

A simple program could just expect certain sub folders to have the server and client programs (along with resources like images etc), build up 2 process objects (makes sense to start the server first, maybe first check if the port the server is to listen on is free, if not, is another instance of server already running etc)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.