Editing CLASSPATH environment

Discussion in 'Mac Programming' started by ixcode, Sep 27, 2004.

  1. macrumors newbie

    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.
  2. macrumors 65816


    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?
  3. macrumors 603


    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.
  4. macrumors newbie

    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?
  5. macrumors 65816


    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.
  6. macrumors 603


    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.

Share This Page