Remote access to Unix
SSH to hobbes.seas.gwu.edu
Getting ssh
This should bring up a window in which commands can be typed
C:\>javac
Usage: javac <options> <source
files>
where possible options include:
-g
Generate all debugging info
-g:none
Generate no debugging info
-g:{lines,vars,source}
Generate only some debugging info
-O
Optimize; may hinder debugging or enlarge class file
-nowarn
Generate no warnings
-verbose
Output messages about what the compiler is doing
-deprecation
Output source locations where deprecated APIs are us
ed
-classpath <path>
Specify where to find user class files
-sourcepath <path>
Specify where to find input source files
-bootclasspath <path>
Override location of bootstrap class files
-extdirs <dirs>
Override location of installed extensions
-d <directory>
Specify where to place generated class files
-encoding <encoding>
Specify character encoding used by source files
-target <release>
Generate class files for specific VM version
This means that java development kit is in your path.
C:\>javac
The name specified is not recognized
as an
internal or external command, operable
program or batch file.
This indicates that the java development kit is not
yet in your classpath. Please notify TA/Instructor of this immediately
so it can be permanenetly fixed.
To fix temporarily,
a) Locate the javac program on your computer using Start-> Find -> Files
or folders.
Let us suppose it is in c:\jdk1.3\bin
b) Type in the command
set PATH=%PATH%;c:\jdk1.3\bin
and press enter
c) Try step 1 again. If it fails, the path has not been set correctly.
If it works, it is temporary for the current command window only. Any other
command windows opened later will require their
path to be set again to access javac following steps a and b.
In order to use class files located in a directory
different than the current directory or to use class files that have been
packaged into a single jar file, a classpath needs to be given to the javac
or java programs. This can de done
in ONE of two ways
e.g. javac -classpath c:\projects;c:\myalgs;.
HelloWorld.java
As
can be seen, different directories are separated by the ';'separator
in Windows. The '.' directory indicates
to look for files in the current directory as well. This is especially
important when the files to be compiled or run are in the current directory.
This can be done in the command window by typing the command
e.g. set CLASSPATH=%CLASSPATH%;c:\projects;c:\myalgs;.
Now this classpath can be used by javac or java without specifying the -classpath switch
e.g javac HelloWorld.java
Note: The set classpath is usable in the current command window only.
Any other command windows that will be opened, will need to have their
CLASSPATH set again.
If there is no output to the screen, that means that there is no classpath
set at this point of time (or it was set incorrectly).
Instead if the output is like
C:\>echo %CLASSPATH%
"C:\Program Files\JavaSoft\JRE\1.3.1\lib\ext\QTJava.zip;."
This means that the classpath has been correctly set and is the above
value.
Emacs is a text editor providing a graphical user interface. Emacs will
be used for writing java programs over the semester. Most menu commands
are similar to those in a regular text editor. Most of these commands can
also be issued using the keyboard.
For a small tutorial on emacs, select Help-> Tutorial from the emacs
menu bar or type Ctrl + H
Setting up path for java development kit
>javac
Usage: javac <options> <source
files>
where possible options include:
-g
Generate all debugging info
-g:none
Generate no debugging info
-g:{lines,vars,source}
Generate only some debugging info
-O
Optimize; may hinder debugging or enlarge class file
-nowarn
Generate no warnings
-verbose
Output messages about what the compiler is doing
-deprecation
Output source locations where deprecated APIs are us
ed
-classpath <path>
Specify where to find user class files
-sourcepath <path>
Specify where to find input source files
-bootclasspath <path>
Override location of bootstrap class files
-extdirs <dirs>
Override location of installed extensions
-d <directory>
Specify where to place generated class files
-encoding <encoding>
Specify character encoding used by source files
-target <release>
Generate class files for specific VM version
This means that java development kit is in your path.
>javac
The name specified is not recognized
as an
internal or external command, operable
program or batch file.
This indicates that the java development kit is not
yet in your classpath. Please notify TA/Instructor of this immediately
so it can be permanenetly fixed.
This requires changes to your .profile.
In order to use class files located in a directory
different than the current directory or to use class files that have been
packaged into a single jar file, a classpath needs to be given to the javac
or java programs. This can de done
in ONE of two ways
e.g. javac -classpath ~/projects:~/myalgs:.
HelloWorld.java
As
can be seen, different directories are separated by the ':'separator
in Unix. The '.' directory indicates
to look for files in the current directory as well. This is especially
important when the files to be compiled or run are in the current directory.
This can be done in the command window by typing the command
e.g. export CLASSPATH=$CLASSPATH:~/projects:~/myalgs:.
Now this classpath can be used by javac or java without specifying the -classpath switch
e.g javac HelloWorld.java
NOTE: The export command if typed into your .profile file will set your
classpath permanently for every time you log in to hobbes.
If there is no output to the screen, that means that there is no classpath
set at this point of time (or it was set incorrectly).
Instead if the output is like
>echo $CLASSPATH
/home/student/hozefa/projects:/home/student/hozefa/myalgs:.
This means that the classpath has been correctly set and is the above
value.
Download Java Development Kit - JDK 2 v 1.3
Emacs Text Editor
Note: If you are trying to install Emacs on a unix or linux system, chances
are emacs is already installed.
Check by typing emacs at the shell prompt. If not, download from ftp://ftp.uu.net/archive/systems/gnu/emacs/emacs-20.7.tar.gz
Utilities to extract files in windows
Java Development Environment for Emacs
Extract the following files depending on your operating system
Note: For Windows unzip this file to your c:\
Note: Untar this file by typing tar -xvf jde.tar into your home directory.JDE in Emacs for Unix/Linux