Need a Short Domain Name?

Do I need a domain name to write Java code?

  • If I am sat at work I can easily write some java code - I just use my companies domain name as the package name and I do so without even thinking. If I am sat at home and I don't have a domain name what do I use for my package names? The JSL doesn't say - it recommends using an Internet domain name. It does, however, mention local and casual package names This section specifies a suggested convention for generating such unique package names. Implementations of the Java platform are encouraged to provide automatic support for converting a set of packages from local and casual package names to the unique name format described here. I've not come across anything that does this converting of package names before and I'm not quite sure how it would work in practice. So, my question is twofold: what package naming should I use if I don't have a domain name and if I go the "local" or "casual" route what is the converting mechanism?

  • Answer:

    Use any more-or-less unique name like name of the project or you own name-surname. Domain is just a convention, used to prevent clashes.

pauli at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

dbf is correct regarding naming convention. To perform package name conversion simply use a modern IDE such as IDEA or Eclipse which contain refactoring options to migrate classes to different packages.

Adamski

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.