I\'m trying to open an URI
with Swing that I get above error.
What is the reason and how can I fix it?
When I do it in console everything is OK but
NoClassDefFoundError
can only be caused by a classpath problem.
Because Desktop
is part of jre, make sure that your classpath contains a reference to the jre library.
In Eclipse, you can go to run configurations --> Classpath and check there
UPDATE:
As Andrew suggested, you can also check you have at least java 1.6