-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
SPRING COOKBOOK
By :
We will first install Java 8 because it's not installed by default on Mac OS 10.9 or higher version. Then, we will install Maven 3, a build tool similar to Ant, to manage the external Java libraries that we will use (Spring, Hibernate, and so on). Maven 3 also compiles source files and generates JAR and WAR files. We will also install Tomcat 8, a popular web server for Java web applications, which we will use throughout this book. JBoss, Jetty, GlassFish, or WebSphere could be used instead. Finally, we will install the Eclipse IDE, but you could also use NetBeans, IntelliJ IDEA, and so on.
Install Java first, then Maven, Tomcat, and Eclipse.

~/.bash_profile file, set the JAVA_HOME environment variable. Change jdk1.8.0_40.jdk to the actual folder name on your system (this depends on the version of Java you are using, which is updated regularly):export JAVA_HOME="/Library/Java/JavaVirtualMachines/ jdk1.8.0_40.jdk/Contents/Home"
$ java -version java version "1.8.0_40" Java(TM) SE Runtime Environment (build 1.8.0_40-b26) Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)

~/bin).~/.bash_profile file, add a MAVEN HOME environment variable pointing to that folder. For example:export MAVEN_HOME=~/bin/apache-maven-3.3.1
bin subfolder to your PATH environment variable:export PATH=$PATH:$MAVEN_HOME/bin
$ mvn –v Apache Maven 3.3.1 (12a6b3... Maven home: /Users/jerome/bin/apache-maven-3.3.1 Java version: 1.8.0_40, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_... Default locale: en_US, platform encoding: UTF-8 OS name: "mac os x", version: "10.9.5", arch... …

~/bin).bin subfolder executable:chmod +x bin/*.sh
catalina.sh script:$ bin/catalina.sh run Using CATALINA_BASE: /Users/jerome/bin/apache-tomcat-7.0.54 ... INFO: Server startup in 852 ms
8080 port by default. In a web browser, go to http://localhost:8080/ to check whether it's working.
~/bin).eclipse binary:./eclipse
Tomcat can be run as a background process using these two scripts:
bin/startup.sh bin/shutdown.sh
On a development machine, it's convenient to put Tomcat's folder somewhere in the home directory (for example, ~/bin) so that its contents can be updated without root privileges.
Change the font size
Change margin width
Change background colour