Starting from:

$25

SDEV425-Homework 1 Configuring your Lab Environment Solved

Part I: Environment Set-up and Simple Hello, World
To successfully complete this assignment (and this course), you will need to configure your environment for testing multiple languages. We will use Java JDK and Netbeans to provide this support.

1.      Download and install Java JDK 8 from the Oracle site. Note, you may have previously installed JDK 7 but this course requires JDK 8. The download is available here:

http://www.oracle.com/technetwork/java/javase/downloads/index.html 

You may also need to configure your environment path in Windows. Review the installation guides on the Oracle web sites for details on how to do this.  

2.      Download and install Netbeans full IDE.  The Full IDE includes Java, Java EE, PHP, C/C++ and server tools. The download is currently available here:

https://netbeans.org/downloads/

3.      Once installed, you should review the online documentation and become comfortable starting and running the Netbeans IDE.

4.      Using Netbeans, create your own unique Hello, World application using the Netbeans IDE for Java. Be sure your code runs properly within the Netbeans environment. Note: part of your unique Hello, World application should include the date and time stamp when the application was run. This should be within your Hello, World code. You can add other unique features as you see fit.

 

 

 

 

Part II: Fix security issues in a simple Java application that uses command line arguments. 

 

1.      Download the source file from this week. Found as an attachment in the homework folder.

2.      Create a new Java application in Netbeans and either copy and paste the code or import the existing source file. Note you may need to make package adjustments if you created a different package

Here are text versions of the code and emailaddresses for your reference:

package sdev425; 

 import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; 

 

/** 

 * 

*  @author jim 

 */ 

public class SDEV425_1 { 

 

    /** 

*  @param args the command line arguments 

     */ 

    public static void main(String[] args) { 

        // Read the filename from the command line argument 

        String filename = args[0]; 

        BufferedReader inputStream = null; 

 

        String fileLine;         try { 

            inputStream = new BufferedReader(new FileReader(filename));  

            System.out.println("Email Addresses:"); 

            // Read one Line using BufferedReader 

            while ((fileLine = inputStream.readLine()) != null) { 

                System.out.println(fileLine); 

            } 

        } catch (IOException io) { 

            System.out.println("File IO exception" + io.getMessage()); 

        } finally { 

            // Need another catch for closing  

            // the streams                       try { 

                if (inputStream != null) {                     inputStream.close(); 

                } 

            } catch (IOException io) { 

                System.out.println("Issue closing the Files" + io.getMessage()); 

            } 

 

        } 

    } 

 



 


More products