You need to setup different 'nj4x_server_port' values for different applications running on the same machine.
NJ4X client (Java or C#) application automatically starts socket server, which is bound to 127.0.0.1 IP and 7777 port by default.
This is done for security reason, and you can change IP address and/or port using "nj4x_server_host"/"nj4x_server_port" System properties (Java) or App.config properties (C#)
Each instance of application creates socket server at client machine.
It uses port number specified by nj4x_server_port App.config parameter.
Therefore, it is not possible to start two different applications using the same nj4x_server_port parameter.
P.S.
In distributed environment MT4 terminals would be able to connect to your Java/.Net application, if you set "nj4x_server_host" system property to the available IP address of your app machine, accessible from MT4 terminal's box.
e.g.,
Terminal Server machine: 192.168.0.1
Java/.Net app machine: 192.168.0.123
=> C# App.config:
<configuration>...<appSettings>...
<add key="nj4x_server_host" value="192.168.0.123" />
...</appSettings>...</configuration>
...
// strategy connects to Terminal Server as usual
mt4.Connect( "192.168.0.1", 7788, new Broker(p.Broker), p.Account, p.Password);
=> Java app class: ... static { System.setProperty("nj4x_server_host", "192.168.0.123"); } ...
// strategy connects to Terminal Server as usual
strategy.connect("192.168.0.1", 7788, new Broker("..."), ...