|
For those of you who are not familiar with the terminology of programming, do not worry too much; we will be covering the "buzzwords" as we go along. However, if you are looking for a Java term, you can try going to: http://java.sun.com/docs/glossary.html.
The computer systems at CSU Chico are varied. There are several computer labs with different types of equipment in them. The computer labs available particularly for CSCI and CIS students include:
OCNL 241 linux OCNL 244 Thin Clients to Sun Solaris (unix) workstations OCNL 251 (lab used for CSCI 111) PCs with Windows (Xming access to Unix) The primary server at the College of Engineering, Computer Science and Technology (ECST or ECT) is a Sun 3500 server named tiglon. All of the servers at ECST are named for wildcats. On occasion, bad things happen and tiglon may "go down". The last time this happened it was temporarily replaced by jaguar.
Since such things can happen, it is usually good to log into ect-unix@ecst.csuchico.edu since that will take you to whatever machine is currently acting as the server.lynx is the ECST web server, although you will never have need to access it directly and most of its functions are hidden from the casual user. Students get to lynx's file system by accessing their public_html directory, which is linked symbolically to the lynx machine.
It is often beneficial to work in the computer labs here at CSU Chico. The labs provide an environment where it is easy to get assistance from other students and from tutors (when available) in OCNL 133a. Not everyone has the ability to work from home but if you do, it is very easy if you have an internet connection. You can get the following programs and install them on your system at home and then develop Java applications at home and send them to your ECC Unix accounts for display:
- You'll want the Java JDK download (required) JDK 6 Update 18 version will work for us, free
- Eclipse is a free development environment that can help a lot. We will use it heavily in this class. (required) free
- WinSCP Secure shell for FTP and telnet(ssh) free
- Putty, NOTE: Telnet is not allowed - must be ssh (secure shell) free --- for MAC stuff
- The above 4 are all that you need, but here are other options you might find interesting:
- JGrasp an editor/compiling environment for java
- It also provides Control Structure Diagrams and UML (object models)
- Edit Plus 2, and
- FTP Explorer or WS_FTP. (better to use WinSCP instead since it is supposed to be more secure) I have used fetch Mac's with success
To program with Java, at the very least you would need the Java2 SDK (Standard Development Kit - sometimes called JDK). It is very easy to install as it is a self-extracting zip file that runs an installer. Once it is installed, on Windows machines you might have to edit the PATH environment variable to include the path to the /bin directory of the Java2 SDK. This is done by
- right click on your MyComputer Icon
- choose Properties
- choose the Advanced tab
- choose Environment Variables
- under user variables, if you do not see a PATH variable choose New
- give a variable name of PATH and a variable value of something like C:\Program Files\java\jdk1.6.0_16\bin; (this depends on where you put the code upon installation)
- the above is the directory where you put your java classes when you installed them - you were prompted with this question. Note the bin at the end - that stands for binary and means that it is the directory with all the binaries that you need to run java
- click OK
We will be using Eclipse for our text editor and development environment. However, others of interest exist. Edit Plus 2 is an alternate color syntax highlighted text editor that runs on Windows systems that allows you to enter your Java programs easily. Both development tools have facilities that you can set up to compile programs without leaving the editor. Normally I recommend that you do not do this until you are very familiar with the program and with compiling Java programs by hand. However, this year we will learn Eclipse and then see how it works on UNIX.
Once you have these programs installed you will need a good FTP client. WS_FTP or FTP Explorer are considered good. They are not as secure as WinSCP though. They are both shareware programs. There is a built in FTP client in Windows but it is command line based and difficult to use. FTP stands for File Transfer Protocol and is used to transmit files between your home computer and the Unix system here on campus (slides for FTP: get FTP, login FTP, using FTP) and a tutorial.
So, to communicate securely with the UNIX machines (and hence web server) you will need to install and set up WinSCP and/or Putty as described in the link above. These will give you the ability to edit and compile programs directly on the Unix systems at school as well as to show them on your web pages. The WinSCP "homemade" tutorial is here
You will also need to set up a directory structure that can be used for creating programs. I named mine
javadevand I have subdirectories below it for each class and lab that I do. Here is an example:
c:\javadev\csci111\lab1One scenario for you developing a Java program at home would be for you to edit the program using Eclipse and then FTP'ing that source file to the Unix system and then compiling it there and displaying it on a web browser. Debugging would be done on the local machine and then the process repeated.
Another would be for you to edit the program using Eclipse and then saving the file to the local file system and then compiling it (debugging as needed), and then uploading the completed project to your directory on the Unix system.
Still another scenario would be to use Putty to connect to the server and then editing the files on the Unix system, compiling, debugging, and displaying them on a web browser when done.
These are not the only ways to do this but they are the most common.
Modern computers are digital. They are called digital because that is the language they understand. Computers only work with off and on - 0's and 1's Thus instructions must be in the form of these 0's and 1's Computers work with logic. Real Programmers
Advantages
- Basics are easy to learn.
- Fully Object-Oriented.
- Event Driven.
- Similar syntax to C++.
- No Manual Memory Allocation or De-allocation.
- Automatic Garbage Collection.
- True Arrays.
- No Pointer Math.
- Strongly Typed.
- Single Inheritance.
- Interfaces.
- Robust.
- Architecture Neutral.
Disadvantages
- Interpreted
- Speed.
- Requires a Java Virtual Machine.
- Some C++ features remain.
The Java developers left out the superfluous features of programming languages. Basically, the java developers simply left out those features that inject more errors into a program than are acceptable. Java has a huge sub-set of features that are delivered in libraries which are accessed through the Applications Programming Interface (API). Java might be small and beautiful, as many people say, but the better term is "simple and elegant".
- Designed as a networked programming language.
- Java byte-codes (.class files)
- Java enabled web browser
- appletviewer,
- Java versions: backwards compatibility.
- Standalone programs.
- distributed
For the most part, we use Unix at CSU Chico. If you are familiar with MS-DOS, you will pick up on Unix fairly quickly. Unix commands are entered at a command prompt. Typically this prompt is a dollar sign ($) however, it can be easily changed to other more useful things. Many students like using the bash shell, which will give you much more flexibility.
By default you are in the korn shell or "k shell" (ksh). In the korn shell to change your prompt to display the current hostname and directory you are working in, you could use your favorite editor (probably WinSCP or pico for non-unix users) to edit a file called .profile (in the top directory - which is not public_html but the directory in which the public_html folder is held) to include the following lines:
Bash Shell: To change your prompt to display the current hostname and directory you are working in, you could use your favorite editor to edit a file called .profile to include the following lines: (This only works for the bash shell)
PS1='$SYS:$PWD> '
PS1='\h:\w $'
export PS1If I was logged on to ect-unix and in my public_html directory, this prompt would show:
jaguar:/user/faculty/amk/public_html $If you choose to not change your prompt, you can find out what directory you are currently working in by typing pwd, which stands for Print Working Directory.
To view the contents of a directory in Unix, we use the ls command. This is the list command in Unix. It has several command line switches that can be used to modify the commands behavior. Here are a few of the combinations:
- ls -al - lists all of the files and directories within the current directory along with permission and ownership information.
- ls -l - same as ls -al but omits the files and directories that begin with a period.
- ls - just lists the names of the files and directories without their permissions or who owns them.
- ls -F - shows directories with a / character to identify them as directories.
In order to create a new directory that is a sub-directory of the current directory, you would type: mkdir newdirname, where newdirname is the name of the new directory. You can also create a sub-directory in other directories by prefacing newdirname with the path information to the directory you wish to create it in. ex: mkdir ~/public_html/csci111/lab1 would create a directory named lab1 inside your public_html/csci111/ directory. the ~ character tells the command to start at your home directory.
You may, at times, create files that you do not need any longer. You can remove files with the rm command. Be carefull, it will not ask if you are sure. If you want it to ask you, use rm - i to remove a file. ex: rm -i myuselessfile would remove the file myuselessfile from the directory after prompting if you are sure you want to do that. The only way to recover a deleted file in Unix is if it had been backed up, so do not use the rm command lightly.
The most used command in Unix is the Change Directory command or cd. The cd command is followed by the path to the directory you wish to go to. ex: cd ~/public_html/csci111/lab1 will take you to your lab1 subdirectory in your public_html/csci111/ directory. You do not have to give a full path but rather a relative one will do. ex: cd ../lab1 would take you to back to the previous directory (the ..) and then into a lab1 directory that is expected to be in that previous directory. For instance if you were in ~/public_html/csci111/lab2 and you wanted to go to ~/public_html/csci111/lab1 you would use the cd ../lab1 command.
James Carter, a former CSUC student started a Unix manual online. It can be found here.
Basic DOS
On PC's when doing applications you will need to use the DOS command prompt: