Unable to use Grails 3.0.9 version - grails

I am working on Windows. I am trying to use Grails 3.0.9 version. Previously, I used Grails 2.4.2, everything worked well.
After Downloading and setting windows environment for 3.0.9 of Grails, I typed 'grails help' or 'grails create-app test' on Windows cmd.
It always tell 'Error: Could not find or load main class org.codehaus.groovy.grails.cli.support.GrailsStarter'
Then I try to use 3.0.8, it told the same error. But if I switch to use 2.4.2, it works normally.
Ps. On Grails 3.0.9, I use jdk1.8.0_65.
What I did wrong or what I missed for setting for a new version of Grails.
Thanks.

I Had exactly the same problem. You could try that:
Open a new CMD window and print your variables (PATH, GRAILS_HOME) if set.
Sometimes my variables still referenced my Grails 2.3.7 library and not 3.0.8 which I wanted to use.
That was happening on Windows 10 to me. After a few restarts from CMD all went well. Maybe System variables are somehow cached and not set immediately.

I would recommend using gvm on windows, its a tool to install, switch grails very quickly using windows powershell
its now called sdkman http://sdkman.io/
if your installing on mac or or unix like os
https://github.com/flofreud/posh-gvm has a good tutorial on installing for windows
gvm install grails 3.0.9 , you can set it as the default by saying yes at the end or
gvm use grails 3.0.9
gvm list grails to see what other versions of grails are available to install.
then type grails -version to see what version is installed and test out grails
your grails create-app should then work

Related

ggts null pointer "Retrieving available scripts"

I installed a fresh copy of GGTS on a fresh copy of windows 8 with JDK 1.7 installed.
I tried to get it to compile my existing project which was based on 2.3.6 and it failed miserably as GGTS comes with grails 2.4.2.
I know serveral people who had problems with 2.4.x so decided to stick with 2.3.
So I downloaded 2.3.11 (latest 2.3) and created a GRAILS_HOME pointing to 2.3.11 dir, and JAVA_HOME pointing to the root of the JDK.
On command line, I can now type grails - version and get back 2.3.11.
I restarted GGTS, and deleted the project and createde it again, adding 2.3.11 as a new Grails version, and set the project to use that.
It fails to compile, saying version is wrong. Fair enough. But when I try to launch the command line from GGTS using the gree circular button at the top which looks like 3 cups, it says:
Retrieving available scripts
Retrieving available scripts
An internal error occurred during: "Retrieving available scripts".
java.lang.NullPointerException
Any ideas?
In my case the problem was, that I had moved grails to a different folder. I just had to change the location of grails in the settings. Hope that helps somebody.
check all grails-project's 'app.grails.version' in application.properties, then open window - preferences - groovy -grails, make sure that all VERSIONs were defined ( I use sts, maybe a little difference ).
alternatively
update all application.properties set app.grails.version=2.3.11 ( the version your ggts defined )
Check if your environment variable of GRAILS_HOME is set to the right version of Grails.
I ran into this same issue, and the problem was caused by the Grails installation it was trying to use. It wanted to use the default version that comes with GGTS rather than the one I installed myself.
To fix, go to Window > Preferences > Groovy > Grails, then "Edit" the Grails installation it shows. I had to switch mine from C:\ggts-bundle\grails-2.4.4\ to C:\grails-2.4.2\.

What Grails Version is Needed for WeCeem

I have literally tried every possible combination that I can think of to install weceem as a plugin into an existing sample application that I'm practicing grails development on, nothing has worked. I've tried all the recommended repositories in various combinations and that did not work. I have tried several versions of grails between 2.3.7 to 2.4.2 and cannot get it to work. I followed the documentation on the site for installing the plugin and was not able to get it to successfully work.
Is there another CMS that runs in grails applications that's worth looking at?
Yes, there is one (indeed a new one) called spud cms which can be used. BTW, what was the error you were getting while using weceem plugin?
The plugin should be defined in the plugin section in BuildConfig.groovy as:
plugins {
compile ":weceem:1.2"
}
The plugin should work for version of grails-2.3.x (version 2.3.7 should be ok -- the demo application for weceem you can find there https://github.com/jCatalog/weceem-app ); the version of grails-2.4 is not supported yet in weceem-1.2 (but should be supported in new release that is planned in month or two). Please, provide the error stack-trace, to see the problem.
After some help from July Antonicheva, this is what I did to get it working:
1) Switched to NetBeans IDE
2) I downloaded version 7 of Java (Oracle)
3) Created a brand new project based on Grails 2.3.7
4) Added weceem plugin and made some adjustments to Datasource.groovy to add MySQL support
Everything is working fine now without errors. The current version of weceem needs Grails 2.3.7 and Java 7 in order for it work. I mentioned that I switched to NetBeans IDE, I found it to be a little easier to work with than eclipse and for some reason it seemed to run a little faster.

how to change grails 2.3.8 version to grails 2.1.1

I installed Grails 2.4.0 but my current project needs Grails 2.1.1 version So is it possible to change from Grails 2.4.0 to Grails 2.1.1 version
Mac/Linux
The easiest way to install Grails 3 on Mac and Linux is to use SDKMAN! which we used in the previous section to install Java.
# Install SDKMAN if you haven't
$ curl -s get.sdkman.io | bash
# Install Grails 3
$ sdk install grails 3.3.8
To verify Grails was installed successfully:
$ grails -v
| Grails Version: 3.3.8
| Groovy Version: 2.4.15
| JVM Version: 1.8.0_181
You can also use SDKMAN to switch between Grails versions:
# Easily switch between different versions:
$ sdk use grails 3.2.11
To learn more check out the SDKMAN usage guide http://sdkman.io/usage.html
Windows
Posh-GVM (PowerShell GVM) is the Windows equivalent to SDKMAN (SDKMAN’s original name was GVM - Groovy Version Manager). A few things to note on a Windows system is to keep any whitespace out of your file path and be careful of file and directory length limits. I recommend keeping your Grails app source at C:\source to avoid most issues.
WARNING: The gvmtool dot net URL now redirects to a spam site. A check of archive.org shows it previously redirected to SDKMan.
Are you using Linux or Mac OS X? If so, definitely look into using GVM. You can install different versions of Grails on one machine and easily switch between them by running a command like gvm use grails 2.1.1.
If you are on Windows then you can use GVM with Cygwin or you could try Posh-GVM, which is GVM for PowerShell.
Yes, GVM is a great tool for installing and switching between different versions of Grails

Cannot create grails projects in STS but from command line

I have recently started to work with grails. I was able to create applications and generate stuff. Yesterday I wanted to resume my work, after a little break and ran into the following error, when trying to create a new project:
Command terminated with an exception:
org.grails.ide.eclipse.longrunning.client.GrailsProcessDiedException: Grails process died
(see details for partial output)
Grails process died
------System.out:-----------
------System.err:-----------
This error only occurs when I use the SpringSourceTool, if I try using the command line it works fine. My first reaction was to change the java version from 1.8 to 1.7, but that didn't help. My environment variables look like this (I am running Fedora Linux 19)
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.0.x86_64
GRAILS_HOME=/home/peer/grails/grails-2.3.0
They are also included in the PATH variable.
Can anybody help? Thanks, Peer
This is a known issue in STS:
https://issuetracker.springsource.com/browse/STS-3277
A work-around is provided in the link.
For anyone pulling their hair out trying to create a grails project using the STS extension for Grails, here is my setup and following is what I did to get it working:
-- OSX 10.8.4 Build 12E3067 --
-- STS Version 3.4.0 --
-- Grails 2.3.3 (installed separately to STS) --
Fresh installed STS 3.4.0
I *de*selected the Preferences/Groovy/Compiler/Enable checking for mismatches between
project and workspace Groovy compiler levels
I ONLY selected the Grails Support option when installing the extensions (nothing else)
Restart STS 3.4.0 (i.e. restart eclipse)
I then pointed my Grails project to my existing Grails 2.3.3 installation
Make sure that the environment variable GRAILS_HOME is set and exported in the same
shell from which you invoke STS otherwise you will get a process termination error in
Eclipse (STS)
This worked.

Error running grails application

I have a grails application in 1.3.7 but on running the application it shows following message:
| 'Application expects grails version [1.3.7], but GRAILS_HOME is version [2.1.0] - use the correct Grails version or run 'grails upgrade' if this Grails version is newer than the version your application expects'.
If i type ${GRAILS_HOME} it is pointing to 1.3.7,It means grails home is already pointing to 1.3.7 .
I am also using 2.0.1 for other applications.
Any suggestions ?????
Your PATH environment variable is most likely picking up grails 2.1.0. If you are on unix type which grails to find out which grails dir is in your path.
I think so, you have two grails versions, but one or the two versions is in system path, and was you run, is running a version different of the GRAILS_HOME, you should have only one in path and in GRAILS_HOME, and shold has the same version.

Resources