Welcome to the MacNN Forums.

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.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > classpath woes?

classpath woes?
Thread Tools
Fresh-Faced Recruit
Join Date: Oct 2000
Status: Offline
Reply With Quote
Apr 4, 2001, 03:25 PM
 
i am having a hell of a time getting my classpath problems sorted out. i've downloaded the oracle JDBC thin client for java 2 as a zip file (classes12.zip) and i'm trying to build an app that uses said library, which i have put in "/Users/me/Library/Java". i have set up a classpath environment variable read from "/Users/me/Library/init/tcsh/environment.mine" per the "/usr/share/init/tcsh/README" file instructions. when i type "env" in the terminal shell, i get:

CLASSPATH=/Users/me/Library/Java

so i'm pretty sure that's working okay.

i've set up a project builder project using the java application stationery and added "classes12.zip" to the "Frameworks & Libraries" list under the "Files & Build Phases" tab in my current target settings.

the project compiles great.

when i try to execute the following line of code in the debugger:

"DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());"

i get an exception:

"Exception occurred during event dispatching:
java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver"

and a stack trace.

what have i done wrong? where else could i set the classpath variable?

also, i am getting an identical NoClassDefFoundError exception when JEdit (which is otherwise working fantastically) tries to load the Oracle plugin, which has a dependency on the same library, even when i launch it from the command line explicitly specifying the classpath thusly:

"java -cp /Users/me/Library/Java -jar jedit.jar"

this is really making me mental. any input/suggestions would be greatly appreciated!


[This message has been edited by ultrapod (edited 04-04-2001).]
"we is confronted by an insurmountable tidal wave of opportunity." -pogo
     
Junior Member
Join Date: Apr 2000
Status: Offline
Reply With Quote
Apr 4, 2001, 03:36 PM
 
If you're building stuff from PB, you need to set your classpath added to the properties file in there. If you have more than one, separate them using : It doesn't look at your environment variable. They are per terminal session.

Hope that helps.
     
Fresh-Faced Recruit
Join Date: Oct 2000
Status: Offline
Reply With Quote
Apr 4, 2001, 04:04 PM
 
okay:
"com.apple.mrj.application.classpath = Contents/Resources/Java/Employee.jar:/Users/me/Library/Java/"

does *not* work.

but this does:
"com.apple.mrj.application.classpath = Contents/Resources/Java/Employee.jar:/Users/me/Library/Java/classes12.zip"

woohoo! but why? i thought the point of the classpath was that i didn't need to specify the .zip or .jar explicitly....

interestingly enough, however:

"[chromo:~/Applications/JEdit] me% java -cp /Users/me/Library/Java/classes12.zip -jar jedit.jar &
[1] 606
[chromo:~/Applications/JEdit] me% [error] Error while starting plugin OraclePlugin
[error] java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver
[error] at OraclePlugin.start(OraclePlugin.java:73)
[error] at org.gjt.sp.jedit.EditPlugin$JAR.addPlugin(EditPlug in.java:136)
[error] at org.gjt.sp.jedit.JARClassLoader.loadPluginClass(JA RClassLoader.java:236)
[error] at org.gjt.sp.jedit.JARClassLoader.loadAllPlugins(JAR ClassLoader.java:170)
[error] at org.gjt.sp.jedit.jEdit.main(jEdit.java:303)
"

the problem here persists! argh! so close - thanks for your tip...


[This message has been edited by ultrapod (edited 04-04-2001).]
"we is confronted by an insurmountable tidal wave of opportunity." -pogo
     
Senior User
Join Date: Oct 2000
Location: Lawrence, KS
Status: Offline
Reply With Quote
Apr 4, 2001, 04:31 PM
 
I had similar problems in the past. It could be that a jar file is also
a containier of classes and as such may qualify as a directory -but what the heck do I know, anyway.

For quick hassle free builds your best best is the command line with some
useful aliases for the classpaths.
iMac 17" G4 800MHZ & 768 SDRAM
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:54 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2