installing grails in linux - linux

I am new to using Linux. I installed grails by setting env variable GRAILS_HOME and added ot to PATH variable. I also exported both and when I typed in grails command.. It worked fine. When I closed that terminal session and opened a another new session, all the env variables that I had set up has all gone.
I was wondering how to have them available for all sessions.
Any help is appreciated
Thanks

Edit the .bashrc file of the user launching Grails.
Add the same lines as your commands:
GRAILS_HOME=/home/of/grails
export GRAILS_HOME
PATH=$PATH:$GRAILS_HOME/bin

you need to add $GRAILS_HOME/bin to the PATH (rather than $GRAILS_HOME)
Update
The best way to install Grails on Linux/Mac is to use GVM.
GVM is a tool for managing parallel Versions of multiple Software Development Kits on most Unix based systems. It provides a convenient command line interface for installing, switching, removing and listing Candidates.
In addition to Grails, you can also use GVM to manage your installation of
Groovy
Griffon
Gradle
vert.x

If you have an Ubuntu (or equal) installation. You could add a repository to it. It should do all the stuff for you:
sudo add-apt-repository ppa:groovy-dev/grails
sudo apt-get update
sudo apt-get install grails

you need to set them under ~/.bashrc file and then type source ~/.bashrc in your terminal so you don't have to close and re-open it again.

In /etc/profile.d/ create a script name grails.sh:
export GRAILS_HOME=/opt/grails
export PATH=$GRAILS_HOME/bin:$PATH
Change /opt/grails to where you unzipped grails.
This will make it available for all users.

If you are on ubuntu define the GRAILS_HOME variable with its installation path in /etc/environment and edit the system path variable as shown in second line
GRAILS_HOME=/opt/grails
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/grails2/bin:"

Groovy Grails Installation:
Before starting up install JAVA on linux system
Check java version using command
$> java -version
Install grails on Linux using Installing-a-grails-development-environment-on-linux
Before installing grails will need to install GVM (Grails version manager) from GVM Tool Installation
After installation of GVM from the above link, we will be able to run Grails sample application. Check it out with command
$> grails -version
Check Environment variable is set or not for Java as well as Grails with command
$> printenv
Create demo application and run the server for Grails using:
$> grails create-app demo
Go to path
$> cd demo/
Run the server
$> grails run-app
Run the server on specific port 9090
$> grails run-app -Dserver.port=9090
Tools and running environment set up for Groovy Grails:
Install GGTS (Groovy Grails Tool Suit) using GGTS with Eclipse IDE and tool
Select Eclipse package on linux from the above link:
YouTube Video Tutorial:
All Grails documentation video tutorials for the installations and running sample application is present here YouTube Channel

Related

QXcbConnection: Could not connect to display Aborted, when installing QT on linux

I am trying to install Qt on a Linux machine remotely from a Windows machine using PuTTY.
When I run the command to install Qt on Linux I get the following error:
~/QT# ./qt-unified-linux-x64-2.0.4-online.run
QXcbConnection: Could not connect to display
Aborted
Please suggest any workaround.
You can use the software repository of that Linux distribution.
For example, if it's Debian or Ubuntu:
sudo apt-get install qtbase5-dev
But if you really want to use the installer (usually, when specific Qt version is needed), then try one of the options:
run an X server on that machine
use the --script option of the online installer (you'll have to write a script like here: https://stackoverflow.com/a/34032216/4742108), it will probably need UI anyways
see if the offline installer has an option to run without UI
refer to here: https://community.nxp.com/message/532966
maybe use the cmd "export DISPLAY=:0" and it works
Try to connect with ssh to the host machine using -X to enable X11 display:
ssh <username>#<ip> -X
aqtinstall is a good option: https://github.com/miurahr/aqtinstall
It's a simple command line tool to download and install any Qt version. It's a fork of my old qli-installer script.

Issue with Netbeans on Linux Mint

I just installed Netbeans using the script on Oracle's website and I'm having some trouble getting it to work. After opening Netbeans I went to open up a simple .java file just to test it out and got this error:
"The JDK is missing and is required to run some Neatbeans modules. Please use the --jdkhome command line option to specify a JDK installation or see http://wiki.netbeans.org/FaqRunningOnJre for more information."
I have OpenJDK, and I'm not sure what's meant by using the --jdkhome command line option. I also visited the wiki and it's about doing a full installation of JDK, which I don't think I should need to do. Any help is appreciated.
I think it's better to use Oracle Java JDK rather than Open JDK if you want to use Netbeans for java development
You can use this link to set Oracle Java JDK in Linux Mint
So, it's better to follow theses instructions (JDK install) prior to Netbeans install and all things will go well.
Steps:
1-Remove OpenJDK installation
sudo apt-get update && apt-get remove openjdk*
2- Download Oracle JDK you want to install (for example JDK 8)
Download the *.tar.gz one.
example for current version: jdk-8u65-linux-x64.tar.gz
3- Extract the file and create a folder where to move it
tar -zxvf jdk-8u65-linux-x64.tar.gz
sudo mkdir -p /opt/java
sudo mv jdk1.8.0_65 /opt/java
4- Make JDK system default
sudo update-alternatives --install "/usr/bin/java" "java"
"/opt/java/jdk1.8.0_65/bin/java" 1
sudo update-alternatives --set java /opt/java/jdk1.8.0_65/bin/java
At this stage, you can start the installation of Netbeans IDE and it will automatically detect your Oracle JDK setting
I tested a short HelloWorld Java example, and I don't have any issue.
Here is the setting JDK view in Netbeans:
If you want to add the JAVA Home dir to your system
Proceed like this
You have to be in root mode and then edit this file: /etc/bash.bashrc
and add:
#JAVA HOME
JAVA_HOME=/opt/java/jdk1.8.0_65
export JAVA_HOME
PATH=$PATH:$JAVA_HOME/bin
export PATH
Reboot your Mint system
Now you'll have javac working in command line...

Mcollecitve mco shell command is not working

I am using mcollective-2.8.1 version and installed all the related packages, but its seems like shell command is missing. I am not able to find the package/plugin for shell command.
MCollective Shell is a separate Agent plugin, it is not packaged with the core MCollective software. Agent plugin code is installed into $libdir/mcollective/agent. See the general plugin install guide. You can get the Agent code from GitHub.

Meteor support developing on Windows

Does Meteor support developing on Windows? I did not see any downloads or mention of Windows in the docs.
The "Quick Start" assumes you are on *Nix OS.
Meteor 1.1+: official Windows support launched on https://win.meteor.com/
Meteor 1.0+: there is an official Windows preview.
Meteor 0.8 and older: see http://win.meteor.com/
Proof, Meteor running on Windows.
Edit: See Tom's answer.
Old answer below.
No, this is not yet supported on windows. If you try to install in you will receive the following error:
Sorry, this OS is not supported yet.
As a workaround you can run a linux box in a VM and use that as a server to run meteor but still do all development from within windows. I've done this using VirtualBox to run Ubuntu with no GUI. Here's the steps:
Install VirtualBox
Grab Ubuntu ISO
Setup Ubuntu VM using VirtualBox (just follow the wizard steps)
Install samba on VM to enable file access from windows. This article was a great help.
Install ssh using Ubuntu Software Center. This was helpful.
Shutdown VM and run from a DOS prompt using vboxheadless -startvm "VM Name"
You can then use a ssh client (I'm using cygwin) to connect to the box to run commands e.g. ssh user#box_ip_address
Can browse and edit files using windows file share e.g. \\box_ip_address\share
Can run meteor apps within local browser, just replace the localhost in the address that meteor assigns with the ip address of the box.
I just tried to install it with curl on Windows 7, and got:
Sorry, this OS is not supported yet.
A substantial update as the existing answers to this question are very out of date.
Official Windows support can be found at https://github.com/meteor/meteor/wiki/Preview-of-Meteor-on-Windows
Unofficial Windows support for Meteor can be found on http://win.meteor.com/
There are 3 solutions outlined on win.meteor.com, one native MSI installer, and 2 virtualized solutions based on Vagrant:
1) MSI Installer:
Stephen Darnell has picked up where Tom Wijsman graciously left off.
This solution is the most straight forward way to get Meteor running
on Windows with an MSI Installer provided. There are some trade-offs
because this is a fork and can lag behind the latest version as
Stephen can update to and test the latest version.
2) Vagrant Shell Provisioning
Gabriel Pugliese has posted a guide for how to provision Meteor on
Linux with Vagrant's Shell Provisioning. These may be more accessible
to users familier with Linux and Shell scripts. This solution is
easier to tweak through the straight forward shell commands than the
Chef alternative.
3) Vagrant Chef Provisioning
Matthew Sullivan is maintaining a set of Vagrant files, Chef cookbook,
and guide for provisioning Meteor on Linux with Vagrant. This Chef
solution is a slightly more automated and configurable than the shell
solution, however likely not as simple to tweak beyond the provided
configuration parameters as the Shell solution.
GitHub Repos and details can be found on win.meteor.com. The three authors are very responsive on the Meteor-talk Google Group.
A bit of history:
Unofficial Windows support for Meteor was started by Tom Wijsman, and was supported by Tom until 0.5.9. Versions 0.6.0 and later are by Stephen Darnell, Gabriel Pugliese, and Matt Sullivan.
I do not see Nitrous.io mentioned here.
I am using Nitrous.io together with Nitrous Desktop, which allows you to use your favourite text editor (in my case, Sublime Text).
There is a quick tutorial here and Discover Meteor also deals with this in chapter 2.
It sounds like Windows is not supported yet. If you want to play with it, I would suggest grabbing VirtualBox and installing your favorite flavor of Linux on it.
I downloaded the above .msi installer and installed to c:\Meteor
Add the c:\Meteor directory you just made to your PATH environment variable.
Run the following command: npm install Meteor-Test-Installer
Add the C:\Meteor\bin\node_modules\npm\bin directory you just made to your PATH environment variable.
Log below from my DOS screen:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\mike>cd\
C:\>cd meteor
C:\Meteor>cd C:\Meteor\bin\node_modules\npm\bin
C:\Meteor\bin\node_modules\npm\bin>meteor create try-meteor
try-meteor: created.
To run your new app:
cd try-meteor
meteor
C:\Meteor\bin\node_modules\npm\bin>curl
‘curl’ is not recognized as an internal or external command,
operable program or batch file.
C:\Meteor\bin\node_modules\npm\bin>cd try-meteor
C:\Meteor\bin\node_modules\npm\bin\try-meteor>meteor
[[[[[ C:\Meteor\bin\node_modules\npm\bin\try-meteor ]]]]]
Initializing mongo database… this may take a moment.
Running on: http://localhost:3000/
Open http://localhost:3000/ in broswer ... Voila !!
Hello World!
Welcome to try-meteor.
If you get error like this below :
{
[[[[[ D:\sms\Apps\Meteor\bin\node_modules\npm\bin\try-meteor ]]]]]
Unexpected mongo exit code 127. Restarting.
Unexpected mongo exit code 127. Restarting.
////////////////////////////////////////
////////////////////////////////////////
meteor is out of date. Please run:
meteor update
////////////////////////////////////////
////////////////////////////////////////
Unexpected mongo exit code 127. Restarting.
Can't start mongod. Check for other processes listening on port 3002 or other me
teors running in the same project.
}
Update the MondoDB folder with the latest mogodb files from the mongodb site.
I've found that new coders who are also new to Meteor might have installed it correctly, but are having trouble figuring out how to open and run it. So I'll just address that issue in this post.
1) I assume you went here: http://win.meteor.com/ and downloaded the MSI installer
2) I assume you then created a newapp in meteor and then ran meteor
3) If steps 1 & 2 are complete, you should see this in your command line:
Initializing mongo database... this may take a moment.
=> Meteor server running on: http://localhost:3000/
4) Open Chrome and type in the local host address: http://localhost:3000/
5) Open your newapp folder - should be located in your Meteor folder wherever its installed on your hard drive
6) Open your newapp.html, newapp.css, and newapp.js files in your favorite editor (like Sublime Text 2)
7) Begin editing these files as you like and watch your page automatically update, as Meteor is designed to do.
Voila!! You're building with Meteor. Enjoy!!
As of two days ago, a preview version is available here:
https://github.com/meteor/meteor/wiki/Preview-of-Meteor-on-Windows
Recent check of their site and checking their FAQ, you'll find the Meteor Development Roadmap. They host it on Trello and after the 1.0 launch, you'll see "Official Windows Support." So, it's on the map - now we wait!
https://trello.com/board/meteor-roadmap/508721606e02bb9d570016ae
Using linux in VM you probably want meteorite which isn't easy if you are as bad as I am to Linux... Here's how (thank you johntday Unable to install meteorite on Ubuntu VM):
Here are my Install Steps
Update and Upgrade your Ubuntu Depending on how up-to-date your image is, this may take a while.
sudo apt-get update && sudo apt-get upgrade
Install curl sudo apt-get install curl
Install node http://lucidservices.com/2013/09/17/install-node-on-ubuntu/
Install meteor curl https://install.meteor.com | sh
Install meteorite sudo -H npm install -g meteorite
If you have problems setting a high screen resolution, here's a fix:
http://youtu.be/t36wXUu1UtQ

How to configure java on Linux machine?

I am installing java to my Linux machine. Downloading the jre and jdk and extracting them did not help only - I assume some environmental variables are also needed. What all path variables are needed to be set? With which values? Expecting the java installs itself to <installation-dir>?
Depending on your distribution it may be easiest to install from your package manager. On Ubuntu, for example, you can do:
sudo aptitude install open-jdk
Otherwise, usually the sun (oracle) version of java comes with a .bin file which you need to make executable and run as root in order to get java properly installed.
You shouldn't need to set any environment variables to get java to work, although some applications will require you to set JAVA_HOME, JDK_HOME and/or JRE_HOME to point to the java install's bin directory. You can see where your java install is by looking at where the symlink from
/etc/alternatives/java
points.
Most Linux systems use the Gnu Java implementation by default and don't change this if you install an additional JDK. Therefore you need to explicitly make your new Java installation the default Java to be used. You can do so by running sudo update-alternatives --config java.
If you prefer graphical configuration, you can install the "galternatives" package, which lets you configure all those application defaults in a nice little UI.
You just need to make /usr/bin/java point to the java executable in the directory where you had extracted the JRE/JDK.
If you extracted it to, say, /opt/jdk1.6.0_23/bin/java, then you need to create a link like this:
sudo ln -s /opt/jdk1.6.0_23/bin/java /usr/bin/java
Prior to this, you can choose to backup an old java installation by:
sudo mv /usr/bin/java /usr/bin/java_old
Here is how I installed JRE:
Install Sun Java Runtime.
Get the jdk for linux. Go to the root Directory. Use the following commands to install.
./configure
make
make install
PATH .= New Path where Java is installed.
To go to the root directory for UBUNTU use command "sudo". For FEDORA use "su".

Resources