Newbie - having problems importing packages
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   James_Loxam
Posted On:   Thursday, August 1, 2002 04:12 AM

Hi, I'm currently trying to write an application that requires getting data from the Windows registry. I have downloaded the com.ice.jni.registry package but I cannot get it to work. I am using Forte release 2. I have read articles about problems with the classpath and have tried fiddling around with that, adding the original zip, unzipping and adding the filesystem, and compressing the filesystem into a jar and adding that but none seam to work properly. The autocomplete function of the program recognises the import but when I compile I just get "cannot access ..." and/or "cannot resolve symbol errors". import command: import com.ice.jni.registry.*;    More>>

Hi,

I'm currently trying to write an application that requires getting data from the Windows registry. I have downloaded the com.ice.jni.registry package but I cannot get it to work. I am using Forte release 2. I have read articles about problems with the classpath and have tried fiddling around with that, adding the original zip, unzipping and adding the filesystem, and compressing the filesystem into a jar and adding that but none seam to work properly. The autocomplete function of the program recognises the import but when I compile I just get "cannot access ..." and/or "cannot resolve symbol errors".




import command:




import com.ice.jni.registry.*;




error message:



RegistryControls.java [40] cannot access RegistryKey

bad class file: RegistryKey.class

class file contains wrong class:
com.ice.jni.registry.RegistryKey

Please remove or make sure it appears in the correct subdirectory of the classpath.

RegistryKey key = Registry.HKEY_CURRENT_USER;

1 error



Any help would be greatly appreciated,



Thanks in advance

James Loxam

   <<Less

Re: Newbie - having problems importing packages

Posted By:   Alexander_Krapf  
Posted On:   Thursday, August 8, 2002 08:01 AM

Hi James,


If you're using the classes in a zip/jar file, you just need to add the zip/jar file to the classpath (the file itself, not the directory it is in).


If you're using the uncompressed classes in a directory, you need to add the parent directory of the com directory to your classpath.


Beginners frequently add the directory containing the class that they want to use and forget that the Java runtime will look in the package subdirectories of your classpath root directories.


The other problem you could be having is that you might have to set the -Djava.library.path=

option to specify where the native library for your registry access package is located.


Regards,


Alex

About | Sitemap | Contact