Question

In: Computer Science

Lab 1. Java and the Command Prompt a) Visit the Java SE JDK website and see...

Lab 1. Java and the Command Prompt a) Visit the Java SE JDK website and see which version of Java you need to download. b) If granted permissions, try to see how to modify environment variables (PATH and CLASSPATH). c) Open the command prompt/shell. Use cd and dir (ls on UNIX-like systems) commands to navigate your file system and see what files do you have in different locations e.g. on your flash drive. Pay attention to the file extensions. d) Use move (mv on UNIX-like systems) to rename and move some files of your choice. e) Get a sample Java program, compile and run it.

Solutions

Expert Solution

a) Search JAVA SE JDK in search engine. First website link will take you to java downloads page. There you can see the latest version of java available for download as shown in following image.

After this you can download and install java on your system. I already have previous version of java installed in my system so, i am not downloading it now.

b) how to modify environment variables (PATH and CLASSPATH) ?

I am using windows 7. To set environment variable values you need to click on windows "Start" button. Then Go to "Computer" and right click on it, then go to "properties" it will open the following window.

click on "Advanced system settings" then click on "Environment Variables" in lower right corner. Following window will appear.

Now, click on "New" button under "User variables" section and enter the "Variable name = path" and "Variable value = C:\Program Files\Java\jdk-11\bin" as shown in following image

Click ok on every opened window.

Your environment variables are set now.

c) Open the command prompt/shell. Use cd and dir (ls on UNIX-like systems) commands to navigate your file system and see what files do you have in different locations

Use "dir" command to see present directories. i used "dir" command to see my present directories as shown in following image

Output shows various directories and system files present in C drive for user "KK".

Now we use "cd" command to change our directory. I used "cd Desktop" command to move to "Desktop" directory as shown in following image.

I again used "dir" command to see various files and directories present in my Desktop directory as shown in following image

When we observe output of dir command. we can see various files present on desktop. File extension we found in Desktop directory are, .pdf = Portable document fromat, .zip file format used to compress files, .jpg and .png formats used to represent picture format. .xls format used to represent Microsoft excel sheet.

e) Get a sample Java program, compile and run it.

Open Notepad and type the following simple java code and save that file as A.java in your Desktop directory As shown in following image.

Now, open a command prompt window and use "cd Desktop" command to change current directory to Desktop.

To compile A.java, Type "javac A.java" in command prompt and press enter.

After that to run A.java, Type "java A" in command prompt and press enter. It will print the "Hello World" as output of your java program as shown in following image.


Related Solutions

Visit the website of a large health care organization such as Humana or Tenet Healthcare. See...
Visit the website of a large health care organization such as Humana or Tenet Healthcare. See if you can you find their policies on compliance and ethics. Has the organization addressed all of the essential compliance elements?
1. At the command prompt, use the where command to locate the where.exe file. Copy and...
1. At the command prompt, use the where command to locate the where.exe file. Copy and paste the full path and filename for the where.exe file into the space provided below. 2. At the command prompt, enter the following command and press enter. find "free beer" "c:\Program Files (x86)\Notepad++\*.txt" This command searches for the string "free beer" in all .TXT files in the Notepad++ program folder. According to the output of the find command, which of the files listed below...
Create a python program that will: prompt a user for a command Command get_data Level 1:...
Create a python program that will: prompt a user for a command Command get_data Level 1: Take one of the commands my_max my_min my_range my_sum mean median mode fib factorize prime Requirements: Your commands should be case-insensitive You should use python lists to store data You should NOT use built-in python math functions, or math libraries to compute these values Tips: Write one function that will convert a string with comma-separated numbers into a python list with the numbers. You...
USING COMMAND PROMPT ON LINUX. show how... Linux Users, Groups, and Permissions Lab Objective: Understand how...
USING COMMAND PROMPT ON LINUX. show how... Linux Users, Groups, and Permissions Lab Objective: Understand how to create user accounts Understand how to create group accounts Creating good password policies Understanding permissions and file sharing Setup: You will need a Ubuntu Server VM Walk Through: You are a system administrator who has been tasked to create user accounts for new users on your system. You can pick whatever theme you like as long as there are protagonist and antagonist users:...
Meant to be written in Java JDK 14.0 1. Define 2 double variables. (a) Use method(s)...
Meant to be written in Java JDK 14.0 1. Define 2 double variables. (a) Use method(s) define in Math class to check if these 2 numbers are equal or not. Display result (b) Write code (not to use Math method) check if these 2 numbers are equal or not. Display result
1. Visit Transparency International’s website. Are there any countries that surprise you in terms of their...
1. Visit Transparency International’s website. Are there any countries that surprise you in terms of their perceived corruption? Pick 3 countries you are interested in. Is their relative order what you expected? Explain.
1. What is the difference between reverse integration and vertical integration? 2. Visit the website of...
1. What is the difference between reverse integration and vertical integration? 2. Visit the website of an organization dealing with sport for persons with disabilities. Summarize what you learn. 3. Provide a brief overview of the Special Olympics (state and local Special Olympics program). What is the role of a professional working in the Special Olympics?
Lab to be performed in Java. Lab: 1.) Write a class named TestScores. The class constructor...
Lab to be performed in Java. Lab: 1.) Write a class named TestScores. The class constructor should accept an array of test scores as its argument. The class should have a method that returns the average of the test scores. If any test score in the array is negative or greater than 100, the class should throw an IllegalArgumentException. Write a driver class to test that demonstrates that an exception happens for these scenarios 2.) Write a class named InvalidTestScore...
Visit the Federal Reserve website and answer the following questions in your own words. 1.What is...
Visit the Federal Reserve website and answer the following questions in your own words. 1.What is the mission and legal mandate of the Federal Reserve System? You can check the section "About the Fed"? 2.What policy tools are available to the Fed to achieve its mission? You can check the Monetary Policy sections at the Federal Reserve website ? 3. Part 2: The Fed has increased the target for the federal funds rate three times since the 2007/09 recession. Will...
Visit the Federal Reserve website and answer the following questions in your own words. Part 1:...
Visit the Federal Reserve website and answer the following questions in your own words. Part 1: What is the mission and legal mandate of the Federal Reserve System? You can check the section "About the Fed" What policy tools are available to the Fed to achieve its mission? You can check the Monetary Policy sections at the Federal Reserve website Part 2: The Fed has increased the target for the federal funds rate three times since the 2007/09 recession. Will...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT