Search code examples
javauuid

How to create a UUID or GUID in Java 1.4


I need to create a UUID or GUID in java 1.4. I get a classnotfound exception when i use: java.util.UUID.

There are similar questions here linked below, but none answer with a generator for Java 1.4:

I have also found a few classes online:

What would you suggest I use to create a UUID or GUID in java 1.4?


Solution

  • I suppose there is no chance convincing the client to get off an unsupported version of Java? Which if the answer is no then your only recourse is to use/modify one of the open source implementations from the web. You mentioned two of them in your question, another one you might want to look at is JUG.

    And oh yea, your reference to java.util.UUID failed because it's only available in Java 5 and up.

    Good luck!