Installing and starting the H2 database on Ubuntu - h2

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?

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

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

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.

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

Related

How to run java application automatically when EC2 instance starts without having to run it manually with java -jar file_name-SNAPSHOT.jar?

I tried the following steps but when I access my application in the browser using the url link, it returns a blank page. Here is what I did:
Copy My jar file to /home/ec2-user/
cp myApp-0.0.1-SNAPSHOT.jar /home/ec2-user
Next, I opened the rc.local in the VI editor and appended myApp-0.0.1-SNAPSHOT.jar
vi /etc/rc.local
#
#
#
#
touch /var/lock/subsys/local
//Append the below command:
java -jar /home/ec2-user/myapp-0.0.1-SNAPSHOT.jar
/:wq
Give permission to the symlink by running the following command:
chmod +X /etc/rc.d/rc.local
So I stopped my ec2 instance and after a while, I started it again to see if I was able to test my endpoints without having to manually run my appl with java -jar myApp-0.0.1-SNAPSHOT.jar But it did not succeed. I was told this way of doing is now obsolete. I also tried to follow the following link but the file naming was not obvious to me so I messed up some steps and got to the same result: failed Please can anyone direct me? Thanks! I tried the following steps but when I access my application in the browser using the url link, it returns blank page.

How to excute java file from remote desktop(mstsc)

I logged into my remote desktop location from cmd by mstsc command. Made some changes in java file and saved it. But I am not sure how can I execute the java file from remote location. Can someone help me out.
Thanks and Regards,
Sm.Aslam.
I assume that you mean an uncompiled .java file. In that case, it is as easy as typing the following in Command Prompt:
javac file.java
Note that this requires Java to be installed on the remote computer. If this is not the case, you will have to install it.
Regards,
Gabe

How to install & run colororacle?

ColorOracle is a free color blindness simulator for Window, Mac and Linux. It help to check an UI Color Design for the Color Vision Impaired people.
Its executable file is a .jar. How to install an run colorOracle ?
An alternative solution for the run part is to use Java -jaroption :
java -jar ./colorOracle/ColorOracle.jar
Excerpt from the man java page:
-jar
Execute a program encapsulated in a JAR file. The first argument is the
name of a JAR file instead of a startup class name.
[…./colorOracle/ColorOracle.jar].
See the Jar tool reference page
and the Jar trail of the Java Tutorial #
http://java.sun.com/docs/books/tutorial/jar for information about
working with Jar files and Jar-file manifests.
On linux, via terminal :
cd ./path/to/myfolder
mkdir colorOracle
curl -o ./colorOracle/ColorOracleJar.zip -C - http://colororacle.org/ColorOracleJar.zip
unzip -n ./colororacle/ColorOracleJar.zip -d ./colorOracle
chmod a+x ./colorOracle/ColorOracle.jar
./colorOracle/ColorOracle.jar
For other OS, see http://colororacle.org

appcfg.py is not running with cmd prompt (Windows 7)

I am having strange problem. I used to run appcfg.py to update my app to appengine but now its not working anymore. When I run this command
C:\Program Files <x86>\Google\google_appengine>appcfg.py update E:\path\myApp\
Its not giving me anything, no error no feedback. Its just back to this line
C:\Program Files <x86>\Google\google_appengine>
Any idea about this issue!
P.S. I'm using Python 2.7. My code is updating through google app launcher but I need to run it from cmd prompt as I will be downloading/uploading appengine stuff which launcher doesn't allow me to do!
Thanks
I still had a little trouble with the instructions. Here's the steps I used to create a batch file to use the Google App Engine download_app with Windows 7.
In my example,
I'll use drive, C:
Default python path will be, C:\Python27\python.exe
GAE path (include "), "C:\Program Files (x86)\Google\google_appengine\appcfg.py"
App ID {your_app_id} will be just your app-id name
{your_app_version} is the "Version:" number in your GAE app.yaml file
I'll create a folder on my Windows 7 desktop and call it GAE_App
The desktop folder path will be C:\Users\{username}\Desktop\GAE_App
{your email} will be the Gmail account connected to your GAE
Right-click on the desktop and select New->Text Document. Open the newly created text document and add the following line of code modified for your setup to the blank text document,
C:\Python27\python.exe "C:\Program Files (x86)\Google\google_appengine\appcfg.py" download_app -A {your_app_id} -V {your_app_version} --email={your email} C:\Users\{username}\Desktop\GAE_App
Save the text document and change the file name to GAE_Download.bat
It's important that the extension now says ".bat" instead of ".txt"
Once finished, click on the batch to execute it. You'll be asked for a password and then the files should download into the GAE_App folder on your desktop. Now, whenever you need to download your files, just click on the batch file.
Not sure why Google didn't simply include this feature with their GAE for Windows software.
I faced the same issue. Here is a simple solution.
Just do this following Steps:
Go to program file where google app engine is installed. Generally It is named as Google.
click on appcfg.py and select open with.. Select "Choose Default Programs".
Select Python from programs and select "Always Use the selected program to open this kind of file" .
Now run the command you should get the results on command line.
For reference click here
Fixed by accessing python lib like that
C:\Python27>python appcfg.py update E:\path\myApp\
Here's a solution that worked for me:
"google_appengine/appcfg.py" update "C:\PATH TO APP
The appcfg.bat that should be used is located **C:\Program Files\Google\Cloud SDK\google-cloud-sdk\platform\appengine-java-sdk\bin** and not the empty appcfg.bat that for some unknown reason also was here C:\Program Files\Google\Cloud SDK\
Good practice is to add this path to the system variable PATH
This worked for me
Basis
<PATH_TO_PYTHON>python <PATH_TO_APPCFG.PY>appcfg.py -A <PROJECT_INSTANCE_NAME> update app.yaml
Example
X:\Software\Python2.7\python Q:\SOFTWARE\GoogleAppEngineSDK\appcfg.py -A great-1337 update app.yaml

Programming on a remote machine [Eclipse - ruby]

Has someone used any add-on on eclipse to develop on a remote machine ?
I am having to ssh through the terminal and copy paste the eclipse code
to run it on a remote host that has the necessary permissions for the
task. I am wondering if I can do that on eclipse from my ubuntu desktop
Thanks!
Edit:
https://help.ubuntu.com/community/SSHFS suggested by Shawn Bower works as far as the OS is concerned
Q] Unfortunately eclipse can open the script on remote mounted FS, however it doesnt show up in the Script explorer or in run Configurations. "Invalid working directory"
Q] Is there a way to sudo su when I am using SSHFS.
To give a perspective:
Normally I log into the remote user as myself#remote and then sudo su - powerUser and then use that to run my ruby scripts. Unfortunately I do not have the pswd for powerUser.
So now though I can edit the scripts on eclipse after using SSHFS , I still cant run them as powerUSer.
Thanks !
Have you looked into using sshfs? https://help.ubuntu.com/community/SSHFS. It will allow you to mount the remote file system so it acts as a local filesystem. Then you can just point eclipse at the local path and edit away. I use this for a bunch of sites.

Resources