![]() |
Java setup
Hey there!
I'm having a problem executing a java program on the tablet. I've following the guide on the maemo site, so installed cacao and the gnu classpath. I have the following simple code Code:
public class Main Code:
cacao MainCode:
Exception in thread "main" java.lang.NoClassDefFoundError: |
Re: Java setup
what is the name of the class file you are executing? In java the class name must match the file name, ie a file with a class called Bob must be called Bob.class. Also, if you try and run "cacao folder/Main" it is going to look for a java class with the declaration "package folder" at the top.
|
Re: Java setup
Hello. You need to point your classpath and then always write current folder:
for example, if I use glibj.jar, then export CLASSPATH=/usr/share/classpath/glibj.zip:. cacao -cp /usr/share/classpath/glibj.zip:. Main |
Re: Java setup
@pixelseventy2 - The name of the class file is Main.class so that matches the actual class name. The class is in the default package I guess (in that I didn't explicitly put it in one)
@shanti - Below is what I entered, the current directory /home/user/MyDocs/.documents is where the class file resides. Code:
/home/user/MyDocs/.documents # export CLASSPATH=/home/user/MyDocs/.documents/Main.class:. |
Re: Java setup
Hi dunff2k,
Did you by accident provide a line like Quote:
Quote:
Good luck, Helmuth |
Re: Java setup
@hbr - You're right but in a new version of the class file I copied to the device that is no longer the case, yet the error still refers to test810.Main. The file executes fine from the command line on my windows machine using:
Code:
java MainSo now I'm left wondering what this means Code:
export CLASSPATH=/usr/share/classpath/glibj.zip:.Thanks for your patience with this... |
Re: Java setup
Quote:
export CLASSPATH=/usr/share/classpath/glibj.zip:. cacao -cp /usr/share/classpath/glibj.zip:. Main glibj.zip is package with classes, that are necessary for realtime running java program. In Sun's java or OpenJDK its rt.zip. In Jalimo installation, as I remember it must be glibj.zip. Have you this file? Meanwhile, there is java compiler for Maemo. Try Google "maemo jikes" |
Re: Java setup
OK I seem to have got non GUI java apps working thanks for your input , I can only assume I had too many files of the same name hanging around and was confused.
Now I'm trying to get a GUI based one working as in the SimpleSwtSample on the jalimo site. And running the suggested code on the site gives me a problem. Code:
cacao -cp /usr/share/java/swt-gtk.jar SimpleSwtSampleThe error message I get is: Code:
SimpleSwtSample not found in java.lang.classloader$1{urls=[file:/usr/share/java/swt-gtk.jar], parent = null}Any ideas what it requires of me? |
Re: Java setup
It seems, you forgot one:
cacao -cp /usr/share/java/swt-gtk.jar:. SimpleSwtSample You need always point your current dir in classpath- ":.". |
Re: Java setup
Hey thanks again for the response...
That advances things but upon selecting enter I'm greeted with lots of screens of the same error: Code:
dumping the current stack trace. We received a SIGSEGV andCode:
segmentation fault |
Re: Java setup
Quote:
|
Re: Java setup
yeah works fine
|
Re: Java setup
Never saw that error. Can you type command line that you used and full stack trace?
|
Re: Java setup
@shanti - The command I used was:
Code:
cacao -cp /usr/share/java/swt-gtk.jar:. SimpleSwtSampleCode:
final Shell shell = new Shell(display);Anymore insight? I'm going to try on a different device... |
Re: Java setup
guys problem solved...
Once I updated my version of maemo through the nokia software updater all was resolved. Thanks to all, special thanks @ shanti! |
Re: Java setup
how may I compile my .java to .class on maemo?
is it jikes? installing jalimo-console-example doesnt add the compiler to my device Niv |
| All times are GMT. The time now is 22:04. |
vBulletin® Version 3.8.8