I have to create a program (prefer in Java since it is multi platform), that can run independently, read a file, and write something to a database.
I use H2 DB and I develope with Eclipse.
I developed a little class which does all I need. The class knows how to work with the H2 DB because I inserted the appropriate jar file of the DB
to the "build path" in the Eclipse.
Now, while running the class in command line thru "java class_name" , I get an exception because the jar of the DB is not exsist.
I guess I missed something. Anyways, the main goal is to run it out of the eclypse - in any place I'll put it....
I'll be glad to get some help... Thanks a lot , Moshi.
First of all thanks for your answer...
well, my main goal is that my java program will sit on a few computers, and be available to external calls.
Other sources will call my class that does something. I guess that for calling it they will call my class name
or something, it will be thru httprequest. (As you can see, since it is very new to me I'm not sure exactly how they will call it...).
But in 1 thing I'm sure - it will have to know the H2 jar anyways. How ?
Thanks a lot for any answer !
Joined: Nov 10, 2009
Well, I think I have the answer:
I moved the jar file into same folder of the java class.
Then , I called it like this: java -cp filename.jar; myClass,
like you recommendeed and it worked.
The answer is how to make out of it a single unit that I can invoke
from outside, to send it params and to get from it an answer...
If someone has an isea....