North Hunterdon-Voorhees Regional High School District



Steps to creating new program files (using an existing workspace).Open JCreator (go to start menu - All Programs - Math Shortcuts - JCreator)File Open Workspace Chapter 1 Programs (don’t open it from the front page – use the File menu option and find the workspace on your H: drive.)Right-Click on the workspace and Add - New Project – Empty Project – Next.Write the filename (remember, the name you use here should be, for example: Prog1_1, Project1_5, Lincoln. Click Next – click the JDK version 1.7 – Next – click the compiler (make sure the compiler is checked) – Finish – Finish.Now you are ready to add your file where you will enter your code. Right-click the project you just created – Add – New File – Empty Java File – Next. Now enter your program name (as noted in your instructions – this name must be the same as your class name. The filename/class name can contain letters, digits, underscore, or dollar sign. No other characters or spaces.An empty tab screen should appear for you to enter your program statements.Remember, the format for entering your programs is as follows:/* Program number and description – Prog1A will print to the screen my name surrounded by a box. Your name Date*/public class ProgClassName{ public static void main(String[] args) { //Your code goes here … }}Once you have entered your program, you should build the program. Click Build – Build Project (wait for the compiler to finish)If the complier comes back with Process Completed, then go to step 10. Otherwise, you need to investigate within your code to find the error. Look at the “build output” tab at the bottom of your screen. It usually tells you the error and line the error is on. Once the file is compiled, you are ready to run the program. Click Run – Run Project Your output, if there are no errors, should appear at the bottom section of your screen. If there are errors, you will again, check out the Build Output tab and make corrections to the errors. For errors with the JDK, first check that your program has made the connection with your class name. Click the Project menu item and then choose Project Settings. This will open the Project Settings window. Check the Run address window and make sure it identifies your class name. If not, open the window using the small triangle icon to the right of the box and click the appropriate option. If there is no other option, go back and check all spellings and make sure your statements are written correctly. If anything is wrong such as the following incorrect statements, make the necessary corrections and rerun the program.Public static void main (String [ ] args) public should not be capitalizedpublic void main (String [ ] args) “static” is missingpublic static void (String [ ] args) “main” is missingIf you cannot find anything wrong with your statement, you will need to highlight and copy the code already written, close the file, delete your file and recreate it again using the steps noted.With any other errors, please ask another classmate, then you may ask Mrs. Vida to figure out what is wrong.Steps to Creating a New WorkspaceFor each chapter, you are to create a new workspace. This will keep all programs within each chapter organized and easy to access. Your workspace should always be located on your h: drive so you can access it from any other computer.Open JCreator (go to start menu - All Programs - Math Shortcuts - JCreator)File New – Blank Workspace.Write in a Workspace name, such as Chapter 1 (you are allowed to use spaces in a workspace name) and use the button on the right of the window ( … ) to browse where to locate the workspace. Find your h: drive and open your MyJavaWork folder. You can create a new folder named for the workspace, such as Chapter 1 and place the workspace within this folder.Next, click on the menu bar, File – Open Workspace (NOT just Open) – then browse the Computer folder to find the h: drive and your MyJavaWork folder to find your workspace.Once your workspace is open, right click the workspace and choose Add New Project. Then follow the steps (beginning at step-3) in the previous section to create your new project and new file for your class. ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download