title: Java "hello world" over the internet (RMI, RMI-IIOP, EJB)
body: <p>Ok, I'm at my wits end with this.  I need to write a server and client that can be run on different machines connected to the internet (not on the same network/router).  I've tried RMI, RMI-IIOP, EJB/GlassFish, CORBA and nothing I do works (over the internet).  I must have followed 30 tutorials, examples and guides, but they are all designed to be run on a single machine which doesn't work when attempting to connect remotely from a different computer.</p>
  
  <p>All I want is a "hello world" type example where the server is launched/deployed from computer 1 and the client is run on computer 2 and they can exchange simple objects and variables over the internet.  So I can deconstruct it and "see" what I'm doing wrong.</p>
  
  <p>Please, please, please can someone point me in the direction of a tutorial or just code that specifically communicates over the internet.</p>
  
  <p>I've been all over Oracle, netbeans, coderanch, stackoverflow and found nothing that has helped.</p>
  
  <p>I'm using NetBeans 8.0.2 with GlassFish 4.1 on Windows 7 (both computers)</p>
  
  <p><strong>EDIT - to clarify question.</strong></p>
  
  <p>I have written a program that works in a similar way to Teamviewer where I can monitor the screens of multiple computers on the same network and if needed interact with those computers.  My software essentially grabs screenshots and transmits them as byte arrays as well as sending various simple data objects containing screen, system, mouse and keyboard information.  This works fine with RMI but I want to expand it to be able to support computers who are not on the same network, so via the internet.  I have read here RMI is not suitable and my testing has confirmed that.  So my next logical step was to EJB or RMI-IIOP but I simply cannot get those to work over the network let alone over the internet.  So I'm really asking here for some help to understand what I'm doing wrong, hence the "hello world" over the internet request.  I have very little experience with this and every example is always local, so I need to bridge the gap from local to internet.  I think part of my misunderstanding was that I thought Glassfish exposed my server experiments to the internet and not just locally.  As you can see, I have some gaps in my knowledge that I was hoping you may be able to help me fill.</p>