Jump to content
Compatible Support Forums
Sign in to follow this  
Joey2

Help needed in running Java in Linux iPAQ...

Recommended Posts

Hi,

i have a problem, running java in linux iPAQ. Here is my problem: I have install Blackdown on my iPAQ and it works prefectly on my iPAQ.Now I just wondering my Blackdown only run on command line hyperterminal is there any other way to run my Blackdown?Now I try to run my java app shown below :

 

//include the MIDlet super class

import javax.microedition.midlet.MIDlet;

//include the GUI libraries of MIDP

import javax.microedition.lcdui.*;

 

 

public class HelloWorldMIDlet extends MIDlet {

static HelloWorldMIDlet instance;

HelloWorldDisplayable displayable = new HelloWorldDisplayable();

 

/**Construct the midlet*/

public HelloWorldMIDlet() {

this.instance = this;

}

 

/**Main method*/

public void startApp() {

Display.getDisplay(this).setCurrent(displayable);

}

 

/**Handle pausing the MIDlet*/

public void pauseApp() {

}

 

/**Handle destroying the MIDlet*/

public void destroyApp(boolean unconditional) {

}

 

/**Quit the MIDlet*/

public static void quitApp() {

instance.destroyApp(true);

instance.notifyDestroyed();

instance = null;

}

 

public class HelloWorldDisplayable extends Form implements CommandListener {

 

 

/**Construct the displayable*/

public HelloWorldDisplayable() {

super("Testing");

// set up this Displayable to listen to command events

setCommandListener(this);

try {

initDisplay();

}

catch(Exception e) {

e.printStackTrace();

}

}

 

/**Component initialization*/

private void initDisplay() throws Exception {

// add the Quit command

addCommand(new Command("Quit", Command.STOP, 1));

this.append(new String ("Hello World"));

 

}

 

/**Handle command events*/

public void commandAction(Command c, Displayable d) {

if (c.getCommandType() == Command.STOP) {

// stop the MIDlet

HelloWorldMIDlet.quitApp();

return;

}

 

}

}

}

 

I have already compiled it and try to run it on the J2ME WirelessToolKit and it works fine.So I transfer my *.java and my *.class into my iPAQ and when i try to run it show an Error MSG saying that there is no class definition found etc. So i thought it best to convert it to *.jar but when i try to run it ,it show an error message also saying no class definitaion; files or directory cannot be found. I've cheack my *.java over and over again but I think it's not the coding problem so i think the problem might lies in setting the correct class path but I don't know how to set it so if the problem lies in the setting the path, please guide me step-by-step this is only my assumption.Or my other assupmtion maybe I must download all the class onto my iPAQ if that the case I also don't know how to go about it. So please guide me in how to upload and setting the class path.

 

I'm at my very ends now so can someone be so kind to help me solve my problem..Million Thanks..

 

Share this post


Link to post
Share on other sites

Hi,

I know this is a few months on from your post about running blackdown java but I'm having some problems running it myself and was wondering if you could help me. When I try to run a simple HelloWorld program I get an error saying 'Can't find libjava.so.' I'm thinking it could be a classpath problem and was wondering if it's necessary to set classpaths and if so how can this be done?

 

Thanks!

Share this post


Link to post
Share on other sites

if you're trying "java NameOfClass" and getting an error message

instead of what you expect, try:

"java -classpath /dir1:/dir2/foo/bar/baz.jar:/dir3/blur/blue/arch.zip NameOfClass"

instead.

 

this will specify /dir1 is to be searched for class files, baz.jar is to be

searched for classes within, and so too should arch.zip be searched.

 

otherwise, java only looks in the factory-default-and-don't-mess-with-them

locations.

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×