I’m trying to connect java to a Oracle database within terminal. I’m not very good at terminal and have been struggling with this for 3+ hours. Can someone explain to me how I can properly set my PATH so that java can see the necessary jar files, as well as how to configure my path so that I don’t have to type in the path where java is installed everytime I want to compile and run. I undersatnd this is a question that can be googled, but I’ve been runninginto problem after problem. Please keep in mind that I’m doing this all through PuTTY as I am not on the machine itself. If someone could take the time to answer this question, I would really appreciate it.
Share
Java doesn’t find jar files using the PATH. It finds them using the classpath you pass to the java command (or using the CLASSPATH environment variable, but I wouldn’t recommend using it outside of a local terminal session):
To have the JDK in your path, you need to add
<JDK_PATH>/bin(or<JDK_PATH>\binon Windows) to the PATH environment variable.Read the following section of the Java tutorial.