Paul Osborne - Java/PHP Developer

Monthly Archives: April 2009

Getting the local host name using Java

A quick example of how to get the name of the localhost using the Java InetAddress class. String hostname = null; try { InetAddress localhost = Address.getLocalHost(); if (localhost != null) { hostname = localhost.getHostName(); } } catch (UnknownHostException e) { e.printStackTrace(); } System.out.println(“Hostname is ” + (hostname != null ? hostname : “Unknown”) );

Configuring a Local CVSNT Repository and Eclipse

Configuring the Eclipse IDE to use a local CVS (CVSNT) repository on windows isn’t an entirely obvious procedure since CVS and Eclipse are geared to working on Linux/Unix. It is actually quite simple to do but if you miss a couple of points you could spend hours fiddling with it without any luck. The following [...]