System ClassPath and compiler question
So my system is apparently using an extremely old version of java, something like 1.3.1 or some sort. I have a few questions.
1. I am using Windows XP and would like to know how the command prompt knows that when I type java and javac where to go to find those applications. I understand that the answer is most likely going to be in System ---> Environmental Variables.
2. Assuming that I do NOT change the Environmental Variable, when I java <class name> a file, how can I appropriately tell it to use all the information in C:/Program Files/Java/jre6 (most updated java).
I believe the answer is by using -classpath <above url here>
My problem is that when I use Eclipse on my machine to create applications Eclipse does fine compiling and running the application. However, when I try to compile and run them on my command prompt on my system I get errors such as method not found. So, I am trying to figure out all my alternatives to fixing the problem. This problem will be a wide problem on multiple machines that will use the classfile, so I was hoping I could create a bat or cmd file that would set the correct classpath.
I would appreciate examples if anyone can.
I've tried doing the following and it failed:
java -classpath "C:\Program Files\Java\jre6\bin\*.jar" className
The above was my attempt to say, use all of the new source/code from jre6. However, it is not working.
Thanks in advance.