Installing and starting the H2 database on Ubuntu

匿名 (未验证) 提交于 2019-12-03 08:57:35

问题:

I would like to use the H2 database on Ubuntu 12.10, and went to the website and got the platform independent install file.

The installation instructions are quite literally, "To install the software, run the installer or unzip it to a directory of your choice."

I'm not a Linux novice, so I've used many of the usual install procedures before, but I have no idea what I am supposed to do here. There are no configure or makefiles that I can find, and the documentation doesn't mention anything, and there I can't find anything using google.

I don't know if I am missing something obvious. Can anybody help please?

回答1:

this bash script start the server:

#!/bin/bash java -cp h2*.jar org.h2.tools.Server 

you need the h2-version.jar in the current directory as well



回答2:

A shell script to start the H2 server and browser GUI is included. I don't have Ubuntu right now, but the steps should be:

  • Download the H2 zip file (for example h2-2013-07-28.zip).
  • Open a terminal window

And then run:

cd <download directory> unzip h2*.zip cd h2/bin chmod +x h2.sh ./h2.sh 

This should start the H2 server tool and open a browser window that lets you connect to a database.

The content of the h2.sh script is relatively simple, it is:

#!/bin/sh dir=$(dirname "$0") java -cp "$dir/h2-1.3.173.jar:$H2DRIVERS:$CLASSPATH" org.h2.tools.Console "$@" 

What you can also do is double click the h2*.jar file (if double click is configured to start java), or run this on a command line:

java -jar h2-1.3.173.jar 


回答3:

If you're using Maven to download h2 database, then try to find out where does it saves (~/.m2/repository/com/h2database/h2/.../h2-version.jar). Since h2 dependency has all downloaded for you, then you just doubleclick on jar file (the web browser should open h2 GUI or look for h2 icon on system tray). And yes, GUI is the same as Standalone package has.

Update: as long as icon displays on tray - h2 will be launched. To disable it - right mouse click -> Exit



回答4:

Download h2 from here http://www.h2database.com/h2-2015-01-16.zip, then once the download has completed, unzip in home directory and run the following:

 cd (directory path ).  cd h2/bin.  chmod +x h2.sh.  ./h2.sh. 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!