[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Oracle s driving me crasy



Hi Jean-David,

I'm not sure this is really a Debian question, more of a Oracle/Java
one, but here goes:

I think Java's classpath option overrides any CLASSPATH setting and
only includes classes not jar's. So you will need to either add it into your
CLASSPATH environment variable or specify all against the classpath
parameter.

The second item is the command you are executing java needs virtual
machine code not source code, the exension ".class" is automatically
added so all you need is the package (if any) + class name.  You are
currently asking the virtual machine to directly execute source code, it
can't work it out or find something that looks like a "main" method.

Try something like:

CLASSPATH=<oracle-dir-yada-yada>/ojdbc14_g.jar:.
cd /dbtest/src/dbtest
if its not compiled -> javac DbTest.java
java DbTest

You may need to adjust for libraries, paths etc.  Read more about java
compilers, java vm, classpaths and jars.

Good Luck,
Dale.

ok so here my pb
I have a ORACLE 10g server on a DEBIAN testing and I
can access the guy on port 1521 from my other machine
(also using debian testing) from a database browser
and everything's fine
I m using netbeans IDE 4.0 with jdk 1.4.2-7
I downloaded the jdbc drivers for 10g : ojdbc14_g.jar I put it in my everyday desktop (not the server) and
as i said I just add the jdbc driver and I can browse
the DB.
But when I try "import oracle.jdbc.driver.*"
the compiler returns

/dbtest/src/dbtest/DbTest.java:2: package
oracle.jdbc.driver does not exist

but i set the CLASSPATH and in the menu i can even see
the oracle classes associated with my program
also i cd into the ojdbc14_g.jar directory and type

java -classpath . /dbtest/src/dbtest/DbTest.java
and i get the message
Exception in thread "main"
java.lang.NoClassDefFoundError: [...]

Some help?


		
__________________________________ Do you Yahoo!? Make Yahoo! your home page http://www.yahoo.com/r/hs




--
sig=0xda1e;



Reply to: