This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Previous revision | ||
compilers:install_windows [2020/05/25 11:33] |
compilers:install_windows [2021/03/19 09:14] (current) zioskenz [Java] |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Install Jflex, CUP and Java in Windows ====== | ||
+ | Guide on how to install Java, Jflex and CUP in the Windows operating system. | ||
+ | |||
+ | < | ||
+ | |||
+ | |||
+ | ==== Java ==== | ||
+ | The Oracle JDK can be downloaded at the following address [[https:// | ||
+ | |||
+ | ==== JFlex and CUP ==== | ||
+ | You can choose to install JFlex and CUP either using the installer we provide you or by following the installation steps manually. | ||
+ | |||
+ | |||
+ | === Manual installation === | ||
+ | 1. Create a folder named '' | ||
+ | |||
+ | 2. Copy the folders '' | ||
+ | |||
+ | 3. Open a command prompt with administrator privileges and execute: | ||
+ | |||
+ | < | ||
+ | cd [installdir]\FLC_Tools\java_cup_v11_draw_tree\java_cup | ||
+ | </ | ||
+ | < | ||
+ | javac *.java runtime\*.java ..\StdDraw.java | ||
+ | </ | ||
+ | |||
+ | 4. Go to control Settings -> System -> About -> System Info -> advanced system settings, or BETTER search for " | ||
+ | |||
+ | 5. Create an environment variable called '' | ||
+ | |||
+ | |||
+ | 5. Add to the '' | ||
+ | |||
+ | 6. Add to the '' | ||
+ | |||
+ | 7. Change the '' | ||
+ | |||
+ | ==== Check installation ==== | ||
+ | To verify that the programs have been installed correctly, open a command prompt (cmd) and enter: | ||
+ | < | ||
+ | jflex | ||
+ | </ | ||
+ | A graphical window should be opened. | ||
+ | |||
+ | For CUP you can type into the command prompt: | ||
+ | < | ||
+ | java java_cup.Main | ||
+ | </ | ||
+ | and if it is correctly installed you see nothing in the terminal. To stop it you can press '' | ||
+ | |||
+ | The installed CUP version contains also the functionality to draw into the screen the parse tree (this version was made especially for this course). To check this part you can type into the command prompt: | ||
+ | < | ||
+ | java java_cup.MainDrawTree | ||
+ | </ | ||
+ | and if it is correctly installed you see nothing in the terminal. To stop it you can press '' | ||
+ | |||
+ | ==== Complete Check of installation ==== | ||
+ | - Download the following code: [[https:// | ||
+ | - Decompress in a directory end type in a terminal the following commands | ||
+ | < | ||
+ | jflex scanner.jflex | ||
+ | java java_cup.MainDrawTree parser.cup | ||
+ | javac *.java | ||
+ | java Main example_expr.txt | ||
+ | </ | ||
+ | |||
+ | === Other possible installation method (with Installer) NOT RECOMMENDED === | ||
+ | The setup package requires that the JDK is installed on the machine, so make sure you did not skip the previous step or you already had a working Java installation. Download the setup file at the following address [[https:// | ||
+ | FLC Tools installs both Jflex and CUP and properly configures the system environment variables. To check if everything works, please refer to the //Check installation// | ||
+ | If you have problems using the installer, try following the instructions in the //Manual installation)// | ||
+ | |||