[SOLVED] CSCI1302 - Programming Project 1 - Linux and Java warm-up

30.00 $

Category:

Description

5/5 - (1 vote)

In this project, you will create, compile and run a simple Java program on our Linux server.

 

Your program must not output anything else.  

You should use either emacs or vi (both are available on odin) to create the source code for your class.  Also, you should use the javac and java commands to compile and run your program, respectively.

  1. The part of the required output line after “I am ” should be created using the values returned from calls to the static methods getUserName() and getOSName(), provided by the UserIdentifier These methods are declared as: public static String getUserName() public static String getOSName()

Your program should simply print the string  ”I am ”  concatenated  with the values returned by  the getUserName  and getOSName  methods with “ on “ in between.

  1. The UserIdentifier class is included in a jar file, called jar, which is available in directory /home/myid/kkochut/classes on odin (the directory and the jar file are publicly readable). You will have to define the CLASSPATH environment variable or use an appropriate option when compiling and running your program, in order to include access to ident.jar.  If you prefer, you can copy this jar file into your own file space.