Knute Snortum wrote:I think the easiest way is to write or copy some code that uses a server, then in Eclipse, select Run -> Run As... -> Run on Server. If there are no servers, it will start a wizard that will take you through installation. Pick Tomcat 8.0, or the latest version.
I think the best way to think about Tomcat at this point is, it is something that will turn your Java code into a website. So you don't have a main(), you have methods that react to HTTP requests. You don't run it by a java command, you launch it in a server (which has to be running).
Once you launch the Java code in a server, you will use your browser to view and react to the program. Usually the URL is something like localhost:8080/projectName.
I'm just scratching the surface here. This is something you should research a bit and play with a lot.
Knute Snortum wrote:What's your environment? What, if any, IDE are you using? You would probably want to use Apache Tomcat as your servlet container and web server, but this is not beginner stuff! You might want to post another thread in the Servlets forum.
Henry Wong wrote:
Henrique Aguiar wrote:
Alright. I did see something similar somewhere along the internet. So, assuming I'm the administrator (or my parents are, but they won't know how to do this and I have basically access to configure whatever), how exactly would I have the port forwarded from the router to the machine?
Well, it depends on the router... Different routers have different administration setups. So, find the manual for your router first... but to answer your question, most routers support a web interface, so it is likely you will be using a browser to do it.
... and .... routers are generally password protected.... so, you will need to know that too. Now, if your parents don't know what the password is, then most likely you are using the default password. Take a look at the router manual for that as well.
Campbell Ritchie wrote:Yes.
Henrique Aguiar wrote:. . . My question is, should I skip this part then?No.
Is it important for me to learn? . . .
Many people no longer use RMI so you can ignore that section.
Henry Wong wrote:
Henrique Aguiar wrote:I've made several networking apps, but due to the fact that I didn't have a different computer, I didn't get to test them. Now that I did, I've discovered my apps work just fine, if both PCs are on the same network. If I try to use them over different networks, they do not work. Why is that?
The IP addresses used in your example are reserved for private networks (most of them). Most likely you are behind a NAT'ed router. This kinda makes sense, as there is no reason to place all the computers in the library, university, home, etc. directly on the internet.
Unless, of course, you want the computers reachable from the outside. To do that, talk to your network administrator. You need to have the port forwarded from the router (internet connection) to the machine (on the private network) that you want. And you also need to change the code to connect to the router instead.