Routing problem with java language