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



27 maj 2005 kl. 22.24 skrev Stephen Paulsen:

On Thursday, May 26, 2005, at 02:38 pm, jvogler@vogler- software.com 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]

My solution to the problem of getting a preferences node for a specific class from within that particular class was to use Preferences.userNodeForPackage(getClass()) instead of manually typing the "fully qualified class name".class.

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

According to the exception Mr Vogler types the class name with double "vchat's" but possibly with / spearation instead of the proper . separation.

I didnt spot the slashes earlier though and instead
suggested that the class file wasnt properly placed
in a corresponding directory hierarchy or that it had been
jarred with an incorrect structure.

    /// Isak Styf

_______________________________________________
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: Stephen Paulsen <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.