i am new to liferay and is managed to start the liferay sever by setting the environment variable, but when i create a liferay plugin project it doesnt work and shows
ERROR: JAVA_HOME is set to an invalid directory: C:\Program Files\Java\JDK1.7.0_79;
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
whereas the server is running correctly due to correct path of java_home
please help
In Windows, processes cache the environment variables. So if you have changed the environment variables when eclipse was open, new environment variables won't be reflected in eclipse. To solve that problem You can close eclipse and open it from a new instance of windows explorer. If this doesn't solve the problem, open it from the command line with a -clean parameter.
D:\eclipse>eclipse.exe -clean
Hi i installed grails at
c:/grails
directory on my windows 7
after that i created GRAILS_HOME environment variable as mentioned on grails website
but now when i run this command
grails integrate-with --intellij
on command prompt it throws an error :
grails is not recognized as an internal or external command
any thoughts what i am doing wrong here
I have faced the same problem and did as follows to get rid off.
Although you have already mentioned that, you set Environment variables. I am assuring again:
In environment variables dialogue: (user variables section)
1. Set GRAILS_HOME to your extracted grails version as GRAILS_HOME=D:\GrailsEnvironment\grails-2.1.1
2. Set JAVA_HOME to your installed jdk version as JAVA_HOME=C:\Program Files\Java\jdk1.7.0_04
In environment variables dialogue: (System variables section)
1. Edit path and add D:\GrailsEnvironment\grails-2.1.1\bin
2. Edit path and add C:\Program Files\Java\jdk1.7.0_04\bin
If needed reboot your pc again. and in command prompt run 'grails -version' and 'java -version' command to check whether grails and java were perfectly installed.
If error shows then may be your grails package is corrupted, Extract your grails package newly in the specified path again. run the command to check. if necessary reboot and run command.
Thanks
When I'm trying run below code,
D:\apache-tomcat\bin>service.bat install
I got this error.
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
How could I solve this ?
I have found answer for my question. I should add,
set JAVA_HOME=<JAVA INSTALLED Location>
just before set "CURRENT_DIR=%cd%" in service.bat file locate in bin directory in tomcat installed directory.
You need to define environment variable JAVA_HOME and point it to java installed location.
or
you can add below line in in TOMCAT_HOME\bin\startup.bat
set 'JAVA_HOME=<JAVA INSTALLED Location>'
2.If JDK is not installed in your machine, define JRE_HOME and point to installed JRE
I have been trying to install Maven v 3.0.4 on my machine win 7 for the first time.I have a problem setting the path environment System variable I have the following 4 entries :
PATH
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.7.0_04;C:\Program Files\apache-maven-3.0.4\bin;M2_HOME;%M2%
M2_HOME
C:\Program Files\apache-maven-3.0.4\bin
M2
%M2_HOME%\bin
JAVA_HOME
C:\Program Files\Java\jdk1.7.0_04\bin
when I do mvn --version
I get the error:
JAVA_HOME not found in your environment, please set the JAVA_HOME variable in your environment to match the location of your java installation
The java -version displays the java version fine,
what am I doing so horribly wrong? Is the PATH ok?
Help appreciated, thanks.
It is only necessary to set the path to the Maven binary and to the JDK correctly:
set PATH %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.7.0_04\bin;C:\Program Files\apache-maven-3.0.4\bin
Furthermore you need to set the JAVA_HOME correctly which is done under windows like this:
SET JAVA_HOME=C:\Program Files\Java\jdk1.7.0_04
Be aware of setting JAVA_HOME to the root of the installed JDK and not to bin folder it.
The settings of M2 and M2_HOME is not necessary.
from command prompt run the following
set M2_HOME= C:\Program Files\apache-maven-3.0.4
set PATH=%PATH%;%M2_HOME%\bin
set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_04
set PATH=%PATH%;%JAVA_HOME%\bin
cmd.exe
mvn -version
The environmental variables should point to the installation directory of each program respectively, and their corresponding bin folders should be added to the PATH:
Make sure that your JAVA_HOME points to the C:\Program Files\Java\jdk1.7.0_04 (or whatever directory you have installed your JDK to).
Add the %JAVA_HOME%\bin folder to your PATH (e.g. by replacing the part with C:\Program Files\Java\jdk1.7.0_04). Make sure that you use ; to separate different path components.
Likewise, the M2_HOME variable should be assigned Maven's installation directory, e.g. C:\Program Files\apache-maven-3.0.4 and you should add %M2_HOME%\binto the PATH (the part with C:\Program Files\apache-maven-3.0.4\bin;M2_HOME;%M2% can be removed.
The advantage of adding the environmental variables %JAVA_HOME%\bin and %M2_HOME%\bin on the path rather than the fully qualified path is that it will be easy to update Java and Maven (or to have several versions installed in parallell). All you need to do is to update the environmental variable, and the PATH variable will fallow automatically.
I ran into the same issue as the original poster. I checked, double checked, and triple checked everything to conform to what everyone has (correctly) indicated the setup needs to be. I still got the same error. In the end, I ran SET JAVA_HOME=C:\Program Files\Java\jdk1.7.0_45 from the command line and then ran the mvn command and viola.
So, for what ever reason, pss's suggestion did the trick. Obviously, this doesn't really change what everyone else said, because that's exactly what my environment variables look like...just had to hit the JAVA_HOME from the command line.
Oddness.
I followed all the steps but it was not working for me. But as soon i have set the JAVA_HOME Path, in Command prompt just type:
C:>SET JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_91
It is working fine in fraction of seconds. Thanks Everyone.
I faced the same problem on local installation. I tried out all the suggested methods including the SET method but that didn't work for me. In the end, I had to manually add another environment variable to the system, and then after that
mvn -v
gave the appropriate response:
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T04:57:37-07:00)
Maven home: C:\Program Files (x86)\apache-maven-3.3.3-bin\apache-maven-3.3.3\bin\..
Java version: 1.8.0_45, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_45\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 8", version: "6.2", arch: "amd64", family: "dos"
If, like me, you are running mvn -version from the command prompt, and then adding any missing environment variables from the GUI, it is possible that you just have to reload the command prompt after adding the environment variables.
Just exit and run cmd.exe
You need to make a variable of name JAVA_HOME in your Environment and set its value as path to jdk.
Right click on My Computer/ This PC -> Properties
Choose Advance system settings
Open Environment variables
Under System variables click on New... button and give the name
as JAVA_HOME and value as c:/path/to/jdk
Version that I always use. Double click and you get the maven up and running
#echo off
title Maven 3.0.5
set JAVA_HOME=C:\Users\hutingung\Development\jdk\jdk1.6.0_33
set MAVEN_OPTS=-Xmx1024m -Xms512m -XX:MaxPermSize=192m -Dfile.encoding=utf-8
set MAVEN_HOME=C:\Users\hutingung\Development\tools\apache-maven-3.0.5\bin
set PATH=%MAVEN_HOME%;%JAVA_HOME%\bin;%PATH%
#cmd /k
Yes, Appending that path C:\programfiles\maven\bin to path variable in system variables is enough, it will work. No need to add user variables.
I am trying to install grails in my windows 7, I have installed JDK 1.7.0 and downloaded grails from its site and extracted in path "C:\grails", i have jdk in "C:\Program Files\Java\jdk1.7.0". I have set environment variable JAVA_HOME = "C:\Program Files\Java\jdk1.7.0\bin" and GRAILS_HOME = "C:\grails" and added "%GRAILS_HOME%\bin" and JAVA_HOME to path from advanced settings. But when i try to run "grails -v" or "grails help" i get the error "The system cannot find the path specified.". I even changed my directory to "C:\grails" and ran "grails -v" but it is still giving me the same error.
I dont know what is wrong with it, please help me installing this thing.
Thanks
JAVA_HOME = "C:\Program Files\Java\jdk1.7.0\bin" mustn't include 'bin'
You'll want to verify that Java is working correctly first by entering "java -version" at the command line.
When you say you extracted the zip into "C:\grails" does that directory now just have a single sub directory (i.e. "grails-2.5.0" or whatever version you downloaded), or does it contain a bunch of sub directories (bin, conf, dist, doc. etc)?
If the answer is the former, your GRAILS_HOME should point to "C:\grails\grails-2.5.0" instead of just C:\grails\