# How to run Java project in a jar file on Unix from a shell script?

Hi,
I have a Java project in Eclipse and I created a runnable jar file.

Then on Windows, I created a batch file as the following:

set CLASSPATH=%CLASSPATH%;\\some\path\to\a\directory\GUI-ext
java -jar \\some\path\to\a\directory\CSGUI10.jar


And it works fine on Windows.

Now, I try to do the same thing on Unix using tcsh and I have this runGUI.sh.sh file:

setenv CLASSPATH /some/path/to/a/directory/GUI-ext/
java -jar /some/path/to/a/directory/GUI-ext/CSGUI10.jar


When I type the following command nothing happens. The GUI does not start:

tcsh runGUI.sh


What am I missing?
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Well the two classpath settings are different in kind. The Unix one sets a wholly new one where the Windows one appends

Are you sure the second one only contains class files (not jars)?
0
Author Commented:
I set it this way because my \$CLASSPATH is not defined in the beginning on Unix. By doing this I temporarily solve the undefined problem.

The class paths that I add are the same both on Unix and Windows.
0
Commented:
I'm not really familiar with that shell. I would try a test class first before the real app

It's possible that there's actually nothing wrong with the csh script (looks ok to me) and that the problem lies elsewhere
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Author Commented:
ok. I solved the problem. It was about the jre version and the swt library that I use.

Now it works. Thanks,
0
Commented:
:)
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.