How to set ANT_HOME with Windows? - windows

How can I easily set ANT_HOME under Windows? I added "D:\Installz\apache-ant-1.8.2\bin;" to my system environment variable PATH and I also created an ANT_HOME variable.

In Windows 7 you can go to Control Panel\All Control Panel Items\System or right click on Computer and then to “Advance system setting”
Choose Advanced Tab
Click "Environment Variables" button
In System Variables, click "New" button
Set Variable Name: ANT_HOME and value as {directoryPath}\apache-ant-1.8.2 (Ex: D:\Installz\apache-ant-1.8.2)
Click OK
Either click again on New button if you do not have ‘Path’ Variable in there
OR
Select it and edit by adding the value : %ANT_HOME%\bin;
Click OK
To check if ANT is properly configured - In command prompt, type ant -version
It should give the ant version installed on your machine

I expect you to be running on Windows (since you are using %).
Simply add a new environment variable (Right-click on My Computer > Properties > Advanced > environment Variable) or using SET ANT_HOME=<path> using command line (in that cas, it will only be active on that command line).
Once set you should be able to verify its value by doing echo %ANT_HOME% in command line
The % sign around the variable indicates it is an environment variable.
For linux use the export ANT_HOME=<path> in command line or in your ~/.profile (persistent, require logout/login). Use echo $ANT_HOME for verification.

I had a similar problem of installing JAVA JDK & ANT.
I tried installing JDK this way.
Oracle site --> download JDK setup --> double click on the set up file (on your desktop) --> accept all defaults --> finish.
we need to set environment variable in the deployment system.
mycomputer (right click) --> properties --> advanced settings --> Environment variable --> system variable --> add new --> variable name: JAVA_HOME, Variable path: installation path of jdk on you computer --> click ok, ok.
To check the successful installation of Java .
windows + R --> cmd --> Java -Version
you would see the response as below
C:\Users\PRAX>java -version
java version "1.6.0_38"
Java(TM) SE Runtime Environment (build 1.6.0_38-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.13-b02, mixed mode)
This shows that you have successfully installed JDK & set an environment variable too.
ANT installation:
download ant file from http://ant.apache.org/bindownload.cgi
choose a mirror & download the zip (zip is the easiest method to set)
unzip the file on your computer --> copy the path (traverse till bin folder).
Now, we need to set an environment variable,
Cmd --> set ANT_HOME = installation path --> press Enter
if you have correctly entered, it wont throw any error.
now execute, echo %ANT_HOME%
you would see the result as your installation path.
your work is done.
you can check the environment variable even in computer properties by default after executing the above set up.
Hope, its useful.

ANT_HOME is the path to your ant installation dir, in your case "D:\Installz\apache-ant-1.8.2"
and JAVA_HOME is java install dir e.g. "C:\Program Files\Java\jdk1.7.0", that's on my machine
On Windows, %% (percent) symbols are used to signify variables.
so to set both variables you can do either
in command prompt, only valid for the session of the particular command propmt
SET ANT_HOME=D:\Installz\apache-ant-1.8.2
SET JAVA_HOME="C:\Program Files\Java\jdk1.7.0"
or
go to System Properties -> Advanced -> Environment Variables and set to new variables

A more flexible solution is to do all that 'environment stuff' in a batch file that starts your ant script, works also when there are no rights to change the environment variables.See a similar question that came up recently for details.

Related

The Server Instance cannot be started because the IntegratedWebLogicServer Domain was not built successfully

I am new to ADF.In JDeveloper, I tried to run my first project , It asked for a password for the first time, after entering this, it should run my project but it gave the below error-
The Server Instance cannot be started because the IntegratedWebLogicServer Domain was not built successfully.
For more information,
There was a log file too.
Adding environment variable to WLST script USER_MEM_ARGS = -Xms32m -Xmx1024m -XX:MaxPermSize=384m
Log File: C:\Users\absasahu\AppData\Roaming\JDeveloper\system12.2.1.4.42.190911.2248\o.j2ee.adrs\BuildDefaultDomain.log
Label: JDEVADF_PT.12.2.1.4.0_GENERIC_190911.2248.S
Product Home: C:\Oracle\Middleware\jdeveloper\jdeveloper\jdev\
Domain: C:\Users\absasahu\AppData\Roaming\JDeveloper\system12.2.1.4.42.190911.2248\DefaultDomain
BuildDefaultDomain1.py 2022-05-18 07:55:17
cmd.exe /c ""C:\Oracle\Middleware\jdeveloper\oracle_common\common\bin\wlst.cmd" "C:\Users\absasahu\AppData\Roaming\JDeveloper\system12.2.1.4.42.190911.2248\o.j2ee.adrs\BuildDefaultDomain1.py""
Process started
wlst > \Java\jdk1.8.0_331 was unexpected at this time.
Elapsed time: 395 ms
Please help me out.
What I tried-
Set java_home system variable without any whitespaces.(Not worked).
Yeah , Solved my problem.
Go through this link [http://dstas.blogspot.com/2012/09/integrated-weblogic-domain-creation.html][1]
Solution 1- Set environment variables JAVA_HOME , and value as path to your jdk. But keep in mind to shorten(remove whitespaces) like use PROGRA~2 for program files(*86).
Solution 2- If you have more than One java path set on environment variables, remove them.
It will work now. It worked for me too.

Cassandra - "The system cannot find the file specified"

I have installed Cassandra on Windows 10, and now when I try to run it using "cassandra", I get the following error:
Any ideas?
After looking at the file it seems, powershell script cassandra-env.ps1 executes following function:
if (Test-Path Env:\JAVA_HOME)
{
$env:JAVA_BIN = "$env:JAVA_HOME\bin\java.exe"
}
elseif (Get-Command "java.exe")
{
$env:JAVA_BIN = "java.exe"
}
else
{
echo "ERROR! No JAVA_HOME set and could not find java.exe in the path."
exit
}
I'm not an expert on Cassandra stuff, but if I were you I would run this script and make sure $env:JAVA_BIN is set correctly, and from there I would follow its trail and check
ParseJVMInfo function in the conf\cassandra-env.ps1 file which is throwing error in your setup.
Update:
Check JAVA_HOME environment variable and see if it is setup such that [JAVA_HOME]\bin\java.exe exists.
Don't install Cassandra into directory where the name has space in it. Startup script for Windows has problems with such names.
Update after an additional investigation:
Looking more precisely into the code, it looks like it can't start Java with the given command-line switches: -d64 -version - either Java executable isn't in the PATH, or the -d64 switch isn't supported for your version of Java - for example, if you installed 32-bit version of Java. Please try to run the java -d64 -version from the command line to check that it works
In my case I updated my java version and added latest version in system environment and run this command as administrator in cassandra specieid path(C:\Program Files\apache-cassandra-3.11.6\bin).
cassandra.bat -f
its running perfactly!!
and also make sure You must allow the execution of PowerShell Scripts. for this check out this one
https://www.howtogeek.com/106273/how-to-allow-the-execution-of-powershell-scripts-on-windows-7/
actually , its not about the path ...
its about giving the proper access / privilege to the path you are trying to access , that's something have to do with UAC setting on windows , try minimize it and make sure you have the right access through clicking on folder properties and giving permission to your user or everyone to access this path read / change or full control .
so u don't have to uninstall anything :)

Unable to Install WebSphere Developer Tools (WDT)

I've downloaded https://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/pot/LibertyPoT_17.0.0.1_WIN.zip but I'm stuck at step 1 of section "0.5 Install WebSphere Developer Tools (WDT)" in setup.pdf where I see
Am I doing something wrong?
Double-check paragraph at 0.3 Installing Liberty and the Java Runtime and its note:
To install for windows or linux,
a. Liberty is already installed for you {LAB_HOME)/wlp
b. The IBM JRE is already installed for you
{LAB_HOME)/wlp/java [...]
c. The IBM_JRE is set to default Java in
the {LAB_HOME)/wlp/etc/server.env
If you want to override this for a specific server create a server.env
file in the usr/servers/ directory.
*Note: If JAVA_HOME is already set in your shell, then you will need to “unset JAVA_HOME”. To check, execute “env| grep –i java_home”. If
it returns with a value, then execute “unset JAVA_HOME”
Then remind that Eclipse looks for jre/jdk based on vm parameter in eclipse.ini.
In the zip file downloaded it should be
-vm ..\wlp\java\bin\javaw.exe
It should be correct, anyway you could try setting an absolute path so you are sure it doesn't care about working directory.

IBM Worklight - Windows - "'WEBWORKS_HOME' environment variable is undefined"

From the BlackBerry development tutorial I know that first I need to install the BlackBerry 10 WebWorks SDK and then set create a WEBWORKS_HOME environment variable with the SDK path.
I do not how to create the environment variable in Eclipse. I set it through Computer-> Properties-> Advanced Settings-> Environment Variables-> User Variables but it did not worked.
When I add a BlackBerry 10 environment to my application, it gives the following error in the Eclipse Worklight console:
E: blackberry10 build failed: The 'WEBWORKS_HOME' environment variable is undefined. See Worklight Information Center for details.
The environment variable is created in the manner you have described - a dedicated environment variable with the name WEBWORKS_HOME and the value, for example: C:\Program Files\Research In Motion\BlackBerry 10 WebWorks SDK 1.0.4.11.
There is no need to create it in Eclipse
You can check that it correctly exists by opening a CMD window and typing set
Re-start Eclipse and the Build operation should now pass for the BlackBerry 10 environment.

Setting Windows PATH for Postgres tools

I cannot access PostgreSQL through the command line in Windows. Although I am able to create and update the databases, access them through PGAdminIII, and push to Heroku, I am unable to access them directly through my command line using the psql command.
When I try to create a database by using the command
$ createdb mydb
as explained in the PG documentation, I get the message
createdb: command not found
The documentation suggests that in this case, "PostgreSQL was not installed properly. Try calling the command with an absolute path instead." Sure enough, I am able to create a database by entering the direct path to the file:
$ c:/postgreSQL/9.1/bin/createdb mydb
Does this mean that the path can be reconfigured to connect correctly? Or do I need to reinstall? I've reinstalled several times, and have not been able to set the correct path. I currently have both the /bin and /lib paths addedto my system and user(:Umezo) paths, but still no access from the command line.
User variables for umezo
variable name: Path
variable value: C:\PostgreSQL\9.1\bin; C:\PostgreSQL\9.1\lib
System variables
variable name: Path
variable value: C:\PostgreSQL\9.1\bin; C:\PostgreSQL\9.1\lib
Any information or feedback regarding how I can fix my installment would be appreciated.
My info is as below:
I mostly followed these sources here and here. I installed a 32 bit version of 9.1 because some sources suggested issues with 64 bit.
PG download version: Installer Version 9.1 Win x86-32
Operating System: Windows 7 (64 bit)
pg_hba.conf
#TYPE DATABASE USER CIER-ADDRESS METHOD
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
postgresql.conf
# - Connection Settings -
listen_addresses = '*'
port = 5432
max_connections = 100
pg_ident.conf
# *Everything is commented out*
Login Role Umezo #from properties window in PGAdminIII
Properties/Role name: Umezo
Properties/Can login: "check"
Role privileges: all categories "check"
configuring postreSQL PATH variable on Windows 7
I encountered this issue too. I'm using Git Bash, hence the Unix-style $ prompt on Windows.
$ rails db
Couldn't find database client: psql, psql.exe. Check your $PATH and try again.
Here's what I did:
In Windows 7, navigate to:
Control Panel
All Control Panel Items
System
Advanced System Settings
Environment Variables
from the System Variables box select "PATH"
Edit...
Then append this string to the existing PATH Variable Value:
;C:\Program Files\PostgreSQL\9.2\bin
and click "OK" three times to exit the menus.
Now, close the console and restart it.
Navigate back to the directory of your Rails app. In my case, this is accomplished with:
$ cd rails_projects/sample_app
Then, try again:
$ rails db
sources:
How do I put PostgreSQL /bin directory on my path in Windows?
http://railscasts.com/episodes/342-migrating-to-postgresql?view=asciicast
Settings Windows Path For Postgresql
open my Computer ==>
right click inside my computer and select properties ==>
Click on Advanced System Settings ==>
Environment Variables ==>
from the System Variables box select "PATH" ==>
Edit... ==>
then add this at the end of whatever you find their
;C:\PostgreSQL\9.2\bin; C:\PostgreSQL\9.2\lib
after that continue to click OK
open cmd/command prompt.... open psql in command prompt with this
psql -U username database
eg. i have a database name FRIENDS and a user MEE.. it will be
psql -U MEE FRIENDS
you will be then prompted to give the password of the user in question.
Thanks
Set path For PostgreSQL in Windows:
Searching for env will show Edit environment variables for your account
Select Environment Variables
From the System Variables box select PATH
Click New (to add new path)
Change the PATH variable to include the bin directory of your PostgreSQL installation.
then add new path their....[for example]
C:\Program Files\PostgreSQL\12\bin
After that click OK
Open CMD/Command Prompt. Type this to open psql
psql -U username database_name
For Example psql -U postgres test
Now, you will be prompted to give Password for the User. (It will be hidden as a security measure).
Then you are good to go.
All you need to do is to change the PATH variable to include the bin directory of your PostgreSQL installation.
An explanation on how to change environment variables is here:
http://support.microsoft.com/kb/310519
http://www.computerhope.com/issues/ch000549.htm
To verify that the path is set correctly, you can use:
echo %PATH%
on the commandline.
On Postgres 9.6(PgAdmin 4) , this can be set up in Preferences->Paths->Binary paths:
- set PostgreSQL Binary Path variable to "C:\Program Files\PostgreSQL\9.6\bin" or where you have installed
In order to connect my git bash to the postgreSQL, I had to add at least 4 environment variables to the windows. Git, Node.js, System 32 and postgreSQL. This is what I set as the value for the Path variable: C:\Windows\System32;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Program Files\PostgreSQL\12\bin; and It works perfectly.
Set Environment in Windows
Our createdbfile exists in this marked folder .so copy this folder path and paste inside environment variables setting under system variables.
start -> Environment Variables
select Environment variable
Create a new environment variable like this
Add environment variable postgres as %postgres% in the path variable
Now check by taking a new command prompt and typing conda (close already opened terminal or cmd)
Now live
Incase any one still wondering how to add environment variables then please use this link to add variables.
Link: https://sqlbackupandftp.com/blog/setting-windows-path-for-postgres-tools
I am using Windows 8 and the above solutions did not work out for me. I downgraded Postgres from 9.4 to 9.3. Man,it worked :)

Resources