If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

adding new files to jsdk

How do I add new Jar files or third party plugins? I have no idea why my teacher had never showed us how to do this. The only help I've gotten from websites is they say to modify my classpath. I have no idea what that is.

Hi.
Bassically your CLASSPATH is the path which jvm uses to search for all your java classes. It is similar to the PATH vaiable. This is usually automatically changed when java is installed, to point to the default java classes. If you have classes somewhere else, which you want to include, you must change that. This can be done in a few ways.
1. If you have a directory which you always used for your own classes, you can permanently change the variable by changing it in windows: Goto Control Panel->System->Advanced->System Variables. (It may be different depending on the Windows version, mine is in German so the names may be slightly different). You should see the CLASSPATH variable there and then it can be edited. DO NOT ERASE IT! Add to the end of it.
2. You can do it on the command line by typing in the MSDOS box: SET CLASSPATH=%CLASSPATH%;./;c:/temp etc. This basically keeps the old classpath and add to it. This is temporary though.
3. You can do it by writing a myclass.bat file, with all the commandline commands in it eg.:

you can then double-click the bat file and the class will be compiled and then run.

OK a little explanation: the ./ is there so that it lloks in the current directory you are in. After that you can add any directories you want, seperated by semicolons.
Anothe important thing which is not metioned often is: If you want to point to class files, point the classpath to the directory they are in. If you want to point to a jar file, the classpath must point to the directory directly above the one with the jar file.
Good luck.

Yes you could do something like that. But if the jar file is in c:/my_classes/sound.jar, then you must point the CLASSPATH to c:/. You can do it like this:
SET CLASSPATH=%CLASSPATH%;c:/;
If there are classes in the directory you also want to use, you must set classpath to C:/my_classes;
The %CLASSPATH% part is very important as it keeps the current classpath and adds to it. If you dont write that and just write: SET CLASSPATH=c:/my_classes, the system will only have this one directory as your classpath and won´t find all the standard java classes anymore. This is why I suggest before playing around too much with the classpath, make a copy of the current CLASSPATH and save it in a txt file or something, just in case you erase it.