B
balgach
Hello all, i am trying to compile a java application that uses a
specific jdbc driver (postgresql) however im running into a weird
problem im not sure how to fix. When i log into the system, i have my
..profile defining my CLASSPATH, and here is what it says:
[asb7@grid00 asb7]$ echo $CLASSPATH
/opt/j2sdk1.4.2_06/lib/pg73jdbc.jar:.
[asb7@grid00 asb7]$ javac testSQL.java
[asb7@grid00 asb7]$ java testSQL
***Exception:
java.lang.ClassNotFoundException: org.postgresql.Driver
java.lang.ClassNotFoundException: org.postgresql.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at testSQL.<init>(testSQL.java:13)
at testSQL.main(testSQL.java:41)
but if i manually reexport the CLASSPATH it works fine:
[asb7@grid00 asb7]$ CLASSPATH=/opt/j2sdk1.4.2_06/lib/pg73jdbc3.jar:.
[asb7@grid00 asb7]$ export CLASSPATH
[asb7@grid00 asb7]$ javac testSQL.java
[asb7@grid00 asb7]$ java testSQL
Connection to PostgreSQL 7.3.7 successful.
Executing this command: select * from test_relation;
test____
Test Successful!
[asb7@grid00 asb7]$
anyone know why i have to manually reexport my classpath each time to
make it work? it seems to be set up the exact same as in my
..profile...???
Thanks,
Adam.
specific jdbc driver (postgresql) however im running into a weird
problem im not sure how to fix. When i log into the system, i have my
..profile defining my CLASSPATH, and here is what it says:
[asb7@grid00 asb7]$ echo $CLASSPATH
/opt/j2sdk1.4.2_06/lib/pg73jdbc.jar:.
[asb7@grid00 asb7]$ javac testSQL.java
[asb7@grid00 asb7]$ java testSQL
***Exception:
java.lang.ClassNotFoundException: org.postgresql.Driver
java.lang.ClassNotFoundException: org.postgresql.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at testSQL.<init>(testSQL.java:13)
at testSQL.main(testSQL.java:41)
but if i manually reexport the CLASSPATH it works fine:
[asb7@grid00 asb7]$ CLASSPATH=/opt/j2sdk1.4.2_06/lib/pg73jdbc3.jar:.
[asb7@grid00 asb7]$ export CLASSPATH
[asb7@grid00 asb7]$ javac testSQL.java
[asb7@grid00 asb7]$ java testSQL
Connection to PostgreSQL 7.3.7 successful.
Executing this command: select * from test_relation;
test____
Test Successful!
[asb7@grid00 asb7]$
anyone know why i have to manually reexport my classpath each time to
make it work? it seems to be set up the exact same as in my
..profile...???
Thanks,
Adam.