JAVA RUN-TIME ENVIRONMENT:
- Find JDK version 8 download. Follow the menus and download and
install Java
- Update the PATH environment variable to include the Java "bin"
directory. In windows:
- right click and choose properties on MyComputer
- Advanced Tab
- Environment Variables button
- at the bottom in System Variables find the PATH variable and edit it
add this to the end of the list ;C:\Program Files\Java\jdk1.8.0_151\bin;
OR SIMILAR DEPENDING ON YOUR VERSION OF JAVA
ECLIPSE:
- Go to www.eclipse.org
- Click on orange "Download Eclipse" button.
- Click on "Eclipse IDE for Java Developers" or "Eclipse
Classic".
- You are now at the page that lists the possible download sites.
Select a site; once you click you will begin the download. Be sure
to remember where you are saving the download file.
- Once you have downloaded the zipped file, you will need to have WinZip
(downloadable, free from internet!) to unzip the files. If you have
Winzip on your computer then you can just click on the zipped downloaded
file. It will create a directory "/eclipse" on your computer
and copy the files into the directory. The default working directory is
under the /eclipse directory. If you send the eclipse program to
your desktop you can easily specify another working directory (Properties
-> Target -> add "-data c:/users")
NOTEPAD++
- Go to http://notepad-plus-plus.org/
Download and install the latest version
- After installing Java and Notepad++, we need to install the NppExec
plugin (for running user scripts within Notepad++) - do this from the plugin
manager, which can be opened from the "Plugins->Plugin Manager->Show
Plugin Manager" menu item. This requires a restart.
- Next, we need to add a number of scripts. Each script is added by (1)
hitting F6 to start up the "Execute..." dialog, (2) typing/pasting
the script into the "Command(s)" box, (3) selecting "<temporary
script>" in the dropdown box, then (4) typing in the script name
and clicking "Save".
- Each of the following scripts should created (commented name precedes
each script)\
// Compile Java
NPP_SAVE
cd $(CURRENT_DIRECTORY)
javac $(FILE_NAME)
// Run Java
cd $(CURRENT_DIRECTORY)
java $(NAME_PART)
// Run Java with args
cd $(CURRENT_DIRECTORY)
INPUTBOX "Arguments:"
java $(NAME_PART) $(INPUT)
- Note: the Java scripts assume the PATH environment variable has been
updated to include the path to the Java install directory.
- After all scripts are added, go to the "Plugins -> NppExec
-> Advanced options..." menuitem, and check the box labeled "Place
to the Macros submenu" in the upper left corner. Next, we'll add each
of the scripted commands we created earlier to the list --- for each item,
we need to (1) delete the contents of the "Item name:" box, if
there's anything in it, (2) select a script from the "Associated script:"
list, which will automatically populate the "Item name:" box,
and (3) click the "Add/Modify" button.
- Add the scripts in the order they were created. Hit "OK"
to exit the advanced options menu, and restart Notepad++.
- You should now be able to find all the command listed towards the bottom
of the "Macro" menu. Test them as follows:
- For the Java commands, create a file named "Test.java" on
the desktop with the following contents:
class Test {
public static void main(String[] args) {
System.out.println("Arguments:");
for (String arg : args) {
System.out.println(arg);
}
}
}
- On the Macro menu, click on the "Compile Java" and "Run
Java" menu items in sequence. You should see "Arguments:"
in black in the output of the second command. Next, click on the "Run
Java with args" menu item --- a dialog box should pop up --- type
in "1 2 3" (without quotes) and click "OK"; this should
result in the strings "Arguments: 1 2 3" being output on separate
lines (in black) in the console.