forked from sergutsan/groovyck
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.tex
More file actions
96 lines (68 loc) · 3.13 KB
/
Copy pathinstall.tex
File metadata and controls
96 lines (68 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
You can download a free copy of the Groovy compiler and runtime environment
from the web:
\begin{verbatim}
http://groovy.codehaus.org/Download
\end{verbatim}
Groovy can run on any computer with Java installed, including the main
operating systems like Windows, Linux, and Mac. If you do not have
Java installed in your computer, you can install it from the web:
\begin{verbatim}
http://www.java.com/en/download/index.jsp
\end{verbatim}
Java will be used intensively in several of the MSc courses
at Birkbeck, so it is a good idea to install it if you do not have it
yet.
If you do not know whether you have Java or Groovy installed in your
system, you can open a command prompt\footnote{You can find it in Windows in
``Accessories''} and type\footnote{In some systems, you can type
``-v'' instead of ``-version''.} \verb+java -version+
or \verb+groovy -version+.
If they are installed, the result should be something similar to this:
\begin{verbatim}
> java -version
java version "1.6.0_23"
OpenJDK Runtime Environment (IcedTea6 1.11pre) (6b23~pre11-0ubuntu1.11.10.1)
OpenJDK Server VM (build 20.0-b11, mixed mode)
> groovy -version
Groovy Version: 1.7.10 JVM: 1.6.0_23
\end{verbatim}
\subsection*{Compiling and running Groovy programs}
The Groovy compiler is run from the command line.
You first type your program in a text editor. Notepad (in Windows) or
gedit (in Linux) are good options, but any simple editor will
do. Note: If you use a word-processor (like Microsoft Word or
LibreOffice Writer), make sure you save the file as text.
Give the filename a \texttt{.groovy} extension.
Open the command prompt.
Go to the folder where you have saved your Groovy
program using the command ``cd'' (change directory). (You do not have to
do this but it is easier if you do, otherwise you would have to type the full
path for your source code file to compile it.)
Suppose your program is in a file called
\texttt{Myprog.groovy} in the current folder.
You can compile and run your program in one step by typing
\begin{Verbatim}
groovy Myprog.groovy
\end{Verbatim}
If the compilation is successful, you will see the result of your
program on the screen.
%
If there are compilation errors, you will get error messages and you need
to go back to the text editor, correct the program and save it again,
then recompile it.
\subsection*{If you cannot install Groovy\ldots}
\label{sec:if-you-cannot}
If you have problems installing Groovy, you may find this webpage useful:
\begin{verbatim}
http://www.tutorialspoint.com/execute_groovy_online.php
\end{verbatim}
The page provides you with an editor at the top and a console at the
bottom. It will allow you to test your programs online. It is quite
slow compared to using a local machine, but it may help if you find
problems installing Groovy.
Additionally, if you have any problem installing or running Groovy,
feel free to write to Dr.\ Sergio Gutierrez-Santos
(sergut@dcs.bbk.ac.uk). We will come back to you as soon as possible.
%%% Local Variables:
%%% TeX-master: "primer"
%%% End: