PDA

View Full Version : Editing CLASSPATH environment




ixcode
Sep 27, 2004, 11:28 PM
Hello everyone,

i am a novice of java programming. my instructor gave me a task in which cs1.Keyboard class needs to be imported, but neither emacs nor Xcode has this class. could anyone suggest please on how to edit the classpath environment in Xcode or emacs? Thanks so much.



MacFan26
Sep 28, 2004, 01:57 AM
Hello everyone,

i am a novice of java programming. my instructor gave me a task in which cs1.Keyboard class needs to be imported, but neither emacs nor Xcode has this class. could anyone suggest please on how to edit the classpath environment in Xcode or emacs? Thanks so much.
Hm, sounds like something they were supposed to provide you with. Probably a stupid question, but did they post that to the course webpage to download?

jeremy.king
Sep 28, 2004, 09:49 AM
If no webpage - were you given a CD or other disk when you started this course? Based on the package name, its obviously a custom class that your prof has written.

ixcode
Sep 29, 2004, 09:51 PM
actually i borrowed the cd today which comes with our coursepack but its prgram is not compatible wiht mac... well then i found the cs1.Keyboard class in it, i copied it to my classes, but i am having a hard time to understand why it still gives me an error saying that that class doesn't exist. :(

have you guys ever had to write a program with Keyboard class?

MacFan26
Sep 29, 2004, 11:44 PM
If that class is in the same folder with your other classes, and everything compiles, I don't see why it wouldn't find that keyboard class. You might want to find another mac user in your class to see how they set it up.

jeremy.king
Sep 30, 2004, 09:29 AM
The same rules that apply to java development on the PC also apply to the mac. You either have to have the .jar/.class files that you are trying to use/include located in the CLASSPATH directory OR they must reside in the same directory as the program you are trying to run. Also, if you are trying to use it from another program, make sure you use the fully qualified classname in your import statement of your program.

Also, I see you are trying to use XCode. Have you tried Eclipse, it does Java development quite well.

Good luck.