OESF Portal | OESF Forum | OESF Wiki | LinuxPDA | #planetgemini chat on matrix.org | #gemini-pda chat on Freenode | #zaurus and #alarmz chat on Freenode | ELSI (coming soon) | Ibiblio


Welcome Guest ( Log In | Register )

Reply to this topicStart new topic
> Executing Java app from shell script
post May 12 2004, 01:05 PM
Post #1

Group: Members
Posts: 31
Joined: 29-January 04
From: Rochester, NY
Member No.: 1,269


I am rather new at using shell scripts, so I was wondering if anyone could tell me what I am doing wrong here. This is the simple script I put in a file called guitest.sh. I execute it from the working directory /root/Documents with: sh guitest.sh

However I get a "java.lang.NoClassDefFoundError: ZGUI" error back from evm. I can execute the command with the whole classpath stuff in there directly from bash without a problem, but when I throw it in a script I get this error. I am getting into using the Zaval light weight gui components and I wanted to make a script so I wouldn't have to type the classpath stuff in every time I opened up the shell. Thanks.

Note that the "evm -cp ... ZGUI" is on one line but it seems phpBB won't display it that way.

echo "Starting Java GUI Test..."

evm -cp .:/mnt/card/root/Documents/:/root/Documents/lw.jar:/mnt/card/opt/QtPalmtop/lib/awt.jar:/mnt/card/opt/QtPalmtop/lib/core.jar:/root/Documents/lwtext.jar ZGUI

exit 0

Go to the top of the page
+Quote Post
post May 12 2004, 07:40 PM
Post #2

Group: Members
Posts: 157
Joined: 6-November 03
From: Harrisburg PA
Member No.: 867

Looks OK to me. Try running the script without the sh command ... at the command prompt, you should be able to just key in the script name and press enter (you do need the .sh extention to the name).

I'm assuming that your class file is in the same directory as the shell script and that you're in that directory when running the script.

How do you like the Zaval libraries? I saw them when they first came out and they look interesting. How do they perform?

Good luck...
Go to the top of the page
+Quote Post
post May 15 2004, 04:39 AM
Post #3

Group: Members
Posts: 4
Joined: 3-April 04
Member No.: 2,639

I call JAVA Programms the following way,
all classes are included into the jar's
works with and without calling a separate shell
works with and without the "cd" (I use it as I use relative paths within the programm)

cd /mnt/card/myPath/
evm -XappName=runPdc -cp /mnt/card/myPath/Pdc.jar:/mnt/card/myPath/hsqldbz.jar xx.yy.pdc.PdcMain
Install the hsqldbz package (java-hsqldb_1.0.1_arm.ipk)
and have a look at the installed files:
Gives a good start.[/quote]
Go to the top of the page
+Quote Post
post May 25 2004, 12:20 AM
Post #4

Group: Members
Posts: 4
Joined: 26-February 04
Member No.: 2,051

I used to have a similar problem. I had my application main class packed in a jar file, say "myApp.jar". It worked after I explicitly included this jar file into the class path. Including just the local directory (".") doesn't seem to be enough. In this case evm seems to look for a file "myApp.class" rather than "myApp.jar".

Hope this helps.

Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 27th May 2018 - 03:34 PM