Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ixcode

macrumors newbie
Original poster
Sep 27, 2004
2
0
Canada
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

macrumors 65816
Jan 8, 2003
1,219
1
San Francisco, California
ixcode said:
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

macrumors 603
Jul 23, 2002
5,479
1
Holly Springs, NC
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

macrumors newbie
Original poster
Sep 27, 2004
2
0
Canada
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

macrumors 65816
Jan 8, 2003
1,219
1
San Francisco, California
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

macrumors 603
Jul 23, 2002
5,479
1
Holly Springs, NC
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.