BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 12-02-2009, 01:58 PM   #1 (permalink)
New Member
 
Join Date: Nov 2009
Model: none
PIN: N/A
Carrier: none
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with Blackberry JDE and include

Please Login to Remove!

Problem with imports

I have a file structure like this:

C:\Mobisma2\se\mobisma\blackberry\

the workspacefile Mobisma2.jdw is in the Mobisma2 folder

in folder blackberry i have 2 folders: testdriver and configstore that contains 2 classes, testdriver.java and configstore.java as well as the corresponding project files.

so I specify package in these two 2 java files as:

package se.mobisma.blackberry.testdriver

package se.mobisma.blackberry.configstore

Now I want to import configstore into testdriver. The logical( to me) statement would be:

import se.mobisma.blackberry.configstore.*;

does not work. Nor does any other variation I have tried, and I have tried quite a few.


Error message:

C:\Mobisma2\se\mobisma\blackberry\testdriver\testd river.java:8: package se.mobisma.blackberry.configstore does not exist

import se.mobisma.blackberry.configstore.*;



Please enlighten me
Offline  
Old 12-03-2009, 04:05 AM   #2 (permalink)
New Member
 
Join Date: Nov 2009
Model: none
PIN: N/A
Carrier: none
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

What puzzles me is if i do:

import se.mobisma.blackberry.configstore.*;

in the configstore class I get no complaints but doing it in testdriver class I get the following error message


C:\Mobisma2\se\mobisma\blackberry\testdriver\testd river.java:8: package se.mobisma.blackberry.configstore does not exist
import se.mobisma.blackberry.configstore.*;
Offline  
Old 12-03-2009, 08:17 AM   #3 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Show me the package declaration in both modules.
Offline  
Old 12-03-2009, 09:42 AM   #4 (permalink)
New Member
 
Join Date: Nov 2009
Model: none
PIN: N/A
Carrier: none
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

package se.mobisma.blackberry.configstore;

import net.rim.device.api.system.PersistentObject;
import net.rim.device.api.system.PersistentStore;
import java.lang.String;
import net.rim.device.api.util.*;
import java.util.*;
final class configstore
{

---------------------------------------------------

package se.mobisma.blackberry.testdriver;
import net.rim.device.api.system.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import se.mobisma.blackberry.configstore.*;

class testdriver extends UiApplication

-----------------------------------------------
error message:
C:\Mobisma2\se\mobisma\blackberry\testdriver\testd river.java:7: package se.mobisma.blackberry.configstore does not exist
import se.mobisma.blackberry.configstore.*;

to test import of the same package as we are in gives no error message.:

package se.mobisma.blackberry.testdriver;
import net.rim.device.api.system.*;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
//import se.mobisma.blackberry.configstore.*;
import se.mobisma.blackberry.testdriver.*;

class testdriver extends UiApplication
Offline  
Old 12-03-2009, 10:22 AM   #5 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Is configstore.java compiled with no errors?
Offline  
Old 12-03-2009, 11:20 AM   #6 (permalink)
New Member
 
Join Date: Nov 2009
Model: none
PIN: N/A
Carrier: none
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

>Is configstore.java compiled with no errors?

Yes, everything compiles OK until I enter the import statement
Offline  
Old 12-03-2009, 12:10 PM   #7 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Change this:

final class configstore {}

to this

public final class configstore {}
Offline  
Old 12-03-2009, 12:13 PM   #8 (permalink)
New Member
 
Join Date: Nov 2009
Model: none
PIN: N/A
Carrier: none
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is a pic
Attached Images
File Type: jpg importproblem.JPG (73.9 KB, 2 views)
Offline  
Old 12-03-2009, 12:16 PM   #9 (permalink)
New Member
 
Join Date: Nov 2009
Model: none
PIN: N/A
Carrier: none
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I changed to public final class configstore but still get the sam error. No difference
Offline  
Old 12-04-2009, 08:33 AM   #10 (permalink)
New Member
 
Join Date: Nov 2009
Model: none
PIN: N/A
Carrier: none
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Getting desperate.


Can someone please supply sample code or point at existing code on how to import a class in one user developed package into another class in another package. None of the samples in the blackberry sample collecton seems to do that. And no fix in this thread. I need to compare what I am doing that does not work to something that I can replicate and that does work. I mean this is one of the basic features of Java and I need it and It has got me stuck now for 4 days.
Offline  
Old 12-04-2009, 09:13 AM   #11 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

Did you create directories also for configstore and testdriver?

The directories have to match the package structure.
Offline  
Old 12-04-2009, 09:22 AM   #12 (permalink)
New Member
 
Join Date: Nov 2009
Model: none
PIN: N/A
Carrier: none
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

As I wrote in the initial posting:

C:\Mobisma2\se\mobisma\blackberry\

the workspacefile Mobisma2.jdw is in the Mobisma2 folder

in folder blackberry i have 2 folders: testdriver and configstore that contains 2 classes, testdriver.java and configstore.java as well as the corresponding project files.
Offline  
Old 12-07-2009, 04:04 AM   #13 (permalink)
New Member
 
Join Date: Nov 2009
Model: none
PIN: N/A
Carrier: none
Posts: 11
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Solved, skipped the import and fixed it with inline code instead
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.