Also I am wondering maybe there are specific java commands for mac?
If you are using bash as your command shell, open .bash_profile in your favorite text editor. You should already have one in your home directory. If not, you can create it. If use another shell (i.e. ksh, csh, etc.), they run similar profile scripts when loging in. I don't know what the file names are for these other shells, though. If all else fails, you should be able to use .profile instead, which is usually executed no matter which shell you use. For my text editor, I like emacs, so the command line looks something like this:
emacs .bash_profile
The syntax is similar to the autoexec.bat file in Windows 9x/ME. Add something similar to the following lines to the .bash_profile file:
CLASSPATH=.:/usr/local/fubar/Foo.jar:/home/johndoe/myclasses
export CLASSPATH
SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Originally posted by Dirk Schreckmann:
Do you have the source code for cs1.Keyboard? Is this something you're supposed to create as part of your assignment? Did your instructor give you a cs1.Keyboard class? Is it something from your learning materials that is perhaps downloadable from a website?
[ September 28, 2004: Message edited by: Dirk Schreckmann ]
Originally posted by somkiat puisungnoen:
How to compile cs1.Keyboard ?
Example on Windows OS.
source code in c:/src
class file in c:/classes
Code in c:/src/cs1/Keyboard.java
Compile cs1.Keyboard.java
1. cd c:/src/cs1
2. set p=c:/classes
3. set CLASSPATH=.;%p%;%CLASSPATH%
4. javac -d %p% Keyboard.java
5. Keyboard.class should be created in c:/classes/cs1 directory
SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Originally posted by somkiat puisungnoen:
on Unix/Linux OS MUST use
$CLASSPATH or $p replace %CLASSPATH% or %p%
and replace " ; " with " : "
it worked, thanks to you. but i apologize with another question, could you also tell me why it still says that the Keyboard class doens't exist when i complie the Lucky program? if this class needs to be located in java folder then i located it, however it's not doing the job.
SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Originally posted by Miric Ubaydov:
Couldn't open the jar launcher.
the error message:
"The jar file "Keyboard.class" couldn't be launched. Check the Console for possible error messages"
:roll:
SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Consider Paul's rocket mass heater. |