Go to previous page
Go to next page


Commonly when dealing with applets a file called make.sh is used for constructing the applet given java files. Overall, they compile all the java files needed and copies the jar file to the proper directory. In this example, there is a src directory that contains all the java and class files. Also, there is a jar directory that will contain the jar file. A Java Archive (jar) file is a file that contains all the files included in the project and can be extracted similar to a zip or tar file.

Comments are done the same way as the GNUmakefile. The '#' symbol is used to comment a single line.
   1:	# file: make.sh
   2:	#
   3:	
 	
Paths:

Certain directories should be defined here. They can be later accessed with the '$' character then the name.
   4:	# define include and library paths
   5:	#
   6:	COMMON=/home/rirwin/applet/v6.0/v6.0
   7:	SRCHOME=/home/rirwin/applet/v6.0/v6.0/src
   8:	JARPATH=/home/rirwin/applet/v6.0/v6.0/jar
   9:	JARFILE=pattern_recognition.jar
   10:	
	
Compile:

Line 14 compiles all the source files in the source directory. Notice the use of the variable defined with line 7. Also, line 13 uses the "echo" command. This is used commonly just to display the progress of the make file. It may play a role in debugging purposes if problems are encountered. Line 16 compiles the javadoc comments. Most commonly all the html files generated are placed into a doc folder in the main working directory.
   11:	# compile the java classes
   12:	#
   13:	echo "> compiling the source code ..."
   14:	javac -sourcepath $SRCHOME $SRCHOME/*.java 
   15:	javadoc $SRCHOME/*.java -d $SRCHOME/doc
   16:
	
Archive:

Line 20 makes the jar file in the proper directory with the "jar cf" command. The name of the jar file is specified and the path is given.
   17:	# compress and archive the java classes
   18:	#
   19:	echo "> compressing and archiving the classes ..."
   20:	jar cf $JARFILE -C $COMMON .
   21:	
	
Moves Jar:

Line 24 moves the jar file to the jar directory with the "mv" command. The command takes the main working directory then a forward slash followed by the name of the jarfile. Following that there should be a space then the path to the jar directory.
   22:	# move the jar file to the appropriate path
   23:	#
   24:	echo "> dumping the archive file ..."
   25:	mv $COMMON/$JARFILE $JARPATH
   26:	
   27: 	#
   28:	# end of file
	

Go to previous page
Go to next page

Footer
ERC

Home | Projects | Publications | What's New | Contact | About Us | Search | Up

Please direct questions or comments to ies_help@cavs.msstate.edu

Mississippi State University
Footer