Runnig from a package

S

SMMT

I have this aplication created with eclipse that is located at
c:\Projects\TreeJ\
My .class are in c:\Projects\TreeJ\bin and may .java in
c:\Projects\TreeJ\src
It also uses JDOM library and SQL-JDBC Driver. (meaning , there are some
..jar needed)
Using eclipse I have no problem runing the aplication.
I'm cann't run the aplication from outside eclipse. I'm sure my javaw syntax
is not correct , it says the main class is not found.

Inside de src and bin folders there are the package folders no files exist
in src or bin directly.
Can this be the problem ? How can I start the aplication, including all
needed .jar from the command line ? considering I'm inside c:\Projects\TreeJ
....

Thank you.
 
F

Fahd Shariff

change to the bin directory.

Locate your main class (e.g. App) If it is in the package "mypackage"
then you can run it by "java mypackage.App".

To include jars you need to add them to your classpath by appending
":BLAH.jar:BLAH2.jar" and so on at the end of the CLASSPATH variable.

or you can add them to the command line when you run the program. So
the complete command to run would look something like this:

java -classpath $CLASSPATH:BLAH.jar:BLAH2.jar mypackage.App

Hope this makes sense!

Fahd
http://www.fahdshariff.cjb.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top