Howdy fellas! I'm working on a project that requires me use some API's (which are zipped Jar files). The vendors gave their instructions: (a) Unzip the Zip file (I ravished that with Winzip) *(b) The resulting (unzipped) directory has 3 directories among which is the lib directory, add all the .jar in the lib directory to ur Classpath. I did so thru the Enviroment Variable in Windows.
The problem now is that the example code which I am supposed to test doesnt compile. It imports some packages and classes which I can only see if I extract the Jars (ie jar xf jarFile). These imported classes and packages and their member functions are what javac complains about. I believe there's something I'm not doing right. I'll need someone to give me a detailed approach to using jar files in a program, thanks.
But watever you do remember to append the ";" to the end of the path, otherwise the CLASSPATH will not pick up the last path mentioned. --------------------------
Are you sure this is correct. Different jar files should be separated by a ";" but I think it is not required for the last one. Try to add your present directory to the CLASSPATH too. like set CLASSPATH=%CLASSPATH%;.\
The best method I think would be to create a CLASSPATH variable in the Environment variables and add .jar files to it. check to see whether they are in the classpath from the command prompt by typing "set classpath". When you add something include %CLASSPATH% so that earlier set classpath would still exist. One other way would be to have a small batch script which would set your classpath as required for your application. You can run it when its required instead of setting it in Environmental variables.