Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preferences... a second time



On Thursday, May 26, 2005, at 02:38 pm, email@hidden wrote:

Thank you Isak and Krista!
Both of your solutions work. But now I got another think.

Would you, Isak, or Krista care to post those solutions to the list for the benefit of the rest of us?[1]

As I told before, I have a "package com.VoglerSoftware.vchat;" command in my file. After the successful compilation I get now following message when I try to run the class:
Exception in thread "main" java.lang.NoClassDefFoundError: vchat (wrong name: com/VoglerSoftware/vchat/vchat)

The way you state things the impression I get is that you have something like this:

package com.VoglerSoftware.vchat;

public class vchat {
   // [...class contents...]
}

This means your fully qualified class name is actually
   com.VoglerSoftware.vchat.vchat

and the Preferences method invocation should be
   Preferences.userNodeForPackage(com.VoglerSoftware.vchat.vchat.class);

If you were to stay with the conventions as Greg mentioned in
his earlier message (http://lists.apple.com/archives/Java-dev/2005/May/msg00650.html)
the package would be "com.voglersoftware.vchat" and the class could be "VChat"
Preferences.userNodeForPackage(com.voglersoftware.vchat.VChat.class);



...
When I remove the package command it works. I have currently my file in a temporary folder while I am working on it. Do I have to save it at a special place or do I have to set the CLASSPATH or something like that?

Don't set CLASSPATH. The use of the CLASSPATH environment variable has been discouraged by Sun all the way back to Java 1.2

   - Stephen

Thank you in advance!

Yours surely
Jens Vogler

[1] Old-style mailing list "netiquette" said that replies to questions posted to the mailing list should be sent via email to the original questioner, who would then summarize the replies and the solution in a post back to the list. Since that is now altogether ignored, answers should be posted to the list for the benefit of everyone. If someone *does* supply good information in an email reply then that should be relayed to the list by the author of the original question. http://www.fau.edu/netiquette/net/dis.html



Am 26.05.2005 um 21:26 schrieb email@hidden:

Hello to all,
I hope that my following question is not too stupid.
I created a file vchat.java with the class vchat in it and gave it the package name com.VoglerSoftware.vchat .
Now I want to get the prefs node for it to save my preferences. I tried Preferences.userNodeForPackage(com.VoglerSoftware.vchat), Preferences.userNodeForPackage(VoglerSoftware.vchat) and Preferences.userNodeForPackage(vchat) and got always an error message. What do I do wrong? Where is my mistake?


Yours surely
Jens Vogler
--
"If the bug isn't reported, the chance that it will be
 fixed for the final release diminishes rapidly."
    - Amy Fowler, JavaSoft "Swing!" Team

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >Re: Preferences... a second time (From: "email@hidden" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.