Installation and configuration of embedded database H2

Source: Internet
Author: User

First, configure the Java environment

1. First check if the system has its own JDK

Use command: #java-version

No information is installed, if available and the version is low, can be uninstalled as follows:

To view a command:

Rpm-qa | grep java or #rpm-qa | grep GCJ

Shown below:

Libgcj-4.1.2-44.el5

java-1.4.2-gcj-compat-1.4.2.0-40jpp.115 (JDK installation package)

Uninstall command:

Yum -y remove java-1.4. 2-gcj-compat-1.4. 2.0-40jpp.  the

2. Installing the JDK

wget http://download.oracle.com/otn-pub/java/jdk/7u79-b15/jdk-7u79-linux-x64.rpm  -IVH jdk-7u79-linux-x64.rpm

3. Configure Environment variables

Vim/etc/profile

At the bottom of the/etc/profile file, add the following:

Java_home=/usr/java/jdk1. 7 . 0_79jre_home=/usr/java/jdk1. 7. 0_79/Jrepath= $PATH: $JAVA _home/bin: $JRE _home/Binclasspath=.: $JAVA _home/lib/jt.jar: $JAVA _home/lib/tools.jar: $JRE _home/libexport java_home jre_home PATH CLASSPATH

--------------------------------------------------------

Source/etc/profile

*****************************************************************

Second, installation H2

1. Download H2

cd/opt/wget http://www.h2database.com/h2-2015-04-10.zipunzip h2-2015 ---ten. Zip chmod +x build. sh bin/h2. SH

---------------------------------------

2. Configure H2

Modify H2.sh

cd/opt/H2vim bin/h2. SH #!/bin/shdir=$ (dirname"$"-CP  "$dir/h2-1.4.187.jar: $H 2DRIVERS: $CLASSPATH"8082  "  [email protected]"

Note: Org.h2.tools.Server starts in server mode

-tcpallowothers allow remote hosts to access by TCP

-weballowothers allows remote machine access via browser

-webport 8082 The default access port (8082 is an unoccupied port, and if the port is already occupied by another port, it is changed to a different port)

-----------------------------------------------------------------------

Modify Build.sh

Vim build.SH#!/bin/SHif[-Z"$JAVA _home"] ; Then  if[-D"/apps/product/jdk1.6.0_19"] ; ThenExport Java_home=/apps/product/jdk1.6. 0_19Else    Echo "Error:java_home is not defined."  fifiif[" $"=" Clean"] ; Then RM-rf Temp bin;fiif[!-D"Temp"] ; Then mkdirtemp;fiif[!-D"bin"] ; Then mkdirbin;fi"$JAVA _home/bin/javac"-sourcepath Src/tools-d bin Src/tools/org/h2/build/*. Java "$JAVA _home/bin/java"-xmx256m-cp "Bin: $JAVA _home/lib/tools.jar:temp" org.h2.build.Build [email protected ]

-------------------------------------------------------------------------------------------------------

3. Start the H2 service

cd/opt/h2/binnohup. /h2. SH &

----------------------------------------------------------------------

4. Verification

Access http://IP:8082 via a browser

Installation and configuration of embedded database H2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.