Cant set environment variables up with ionic? - angularjs

Herers my variables
ANDROID_HOME
variable: C:\Program Files\Android\android-sdk_r24.0.2-windows\android-sdk-windows
JAVA_HOME
variable: C:\Program Files\Java\jdk1.6.0_45
PATH
variable: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\ant\apache-ant-1.9.4\bin;C:\Program Files\Android\android-sdk_r24.0.2-windows\android-sdk-windows\platform-tools;C:\Program Files\Android\android-sdk_r24.0.2-windows\android-sdk-windows\tools;%ANDROID_HOME%;%JAVA_HOME%;
Now when I open putty and say echo %PATH% all I get back is "%PATH%"? Same for the other two? what am I doing wrong?
also when I try check the versions of ionic and cordova it just says no such file or dictionary? even tho I installed them?
sudo npm install -g ionic
npm seems to be working too? I set up apache but it just says build failed and build.xml does not exist when i do ant -v?

I believe that you also need to add an ANT_HOME system variable. It should just be the path to the main Ant folder (not bin), C:\ant\apache-ant-1.9.4 based on your PATH variable. As for putty and npm, I've never tried this and have only used Windows command line.

echo %PATH% should return location of file system and not variable name.
Your JAVA_HOME and ANDROID_HOME look correct.
But i don't think that #rrjohnson85 is correct for ANT, there isn't any batch files that are not in bin. Mine is set to: C:\Program Files\apache-ant-1.9.4\bin and it works.
You should try to add environment variables with full URI of location on file system and not use other environment vars inside.

Related

Not able to start solr in windows

I have downloaded solr 6.4.0 version and tried starting using solr start from bin directory I end up with following error:
C:\solr-6.4.0\bin>solr start
'findstr' is not recognized as an internal or external command,
operable program or batch file.
C:\solr-6.4.0\bin>
Could you please advise me is there any configuration that i need to do/ how to start?
Thanks.
The program findstr.exe can be found in C:\Windows\system32.
Check if you can find it there.
If it is available, modify your "path" environment variable to include the path "C:\Windows\system32\".
If you have an open command prompt window, exit and re-open it, and check that the %PATH% variable contains the newly added path.
echo %PATH%
Now "findstr.exe" should be available for Solr scripts.
Download solr + copy downloaded folder to c: drive (solr7.2.1)
Download nssm installer + copy downloaded folder to c: drive (solr)
open nssm installer in cmd:
>> cd C:\solr\nssm2.24\win64
>> nssm install solr7
GUI service Installer opens (Enter solr path details)
- C:\solr-7.2.1\bin\solr.cmd
- C:\solr-7.2.1\bin
Install (solr as service gets installed)
Set Environment Variable -> System Variables (JRE Path):
JAVA_HOME: c:\ProgramFiles\java\jre1.8.0_212
Check if solr is running (from services)
Open Solr:
https://localhost:8983/solr/#/
Actually findstr.exe is missing.
So follow these steps:
1.go to C:\Windows\system32\ and copy findstr.exe file.
2. paste this file into the location C:\Program Files\Java\jdk{version}\bin
Then run the this command:
solr.cmd start
Hope this helps.

Can't run program after set path as environment variable

I have set a new environment variable pointing to msbuild.exe folder.
C:\temp\Test>echo %DOT_NET4%
C:\Windows\Microsoft.NET\Framework\v4.0.30319
Now, if I start a new cmd and run "msbuild.exe", the programs runs ok, but after running this simple bat, the program is not found anymore:
"C:\Program Files\TortoiseSVN\bin\svn.exe" checkout %CHECKOUT% %PATH%
cd %PATH%
nuget restore OpenText.sln
msbuild.exe OpenText.sln
msbuild not recognized as an internal or external command.
Thanks in advance
I am seeing the same thing as Joey in his comment. Your use of CD %PATH% is a red flag that indicates a problem.
PATH is a critical environment variable that contains a delimited list of folder paths where important executables are located. The command processor uses that list to locate programs when an external command is issued without the full path to the command.
If PATH is set correctly, then your command CD %PATH% cannot work. But I suspect you have some script that defines PATH to a specific folder, perhaps where nuget is located. In this case, your CD %PATH% command works, but now cmd.exe has no idea where msbuild.exe is located.
Moral of the story - don't ever use PATH for your own purposes. Pick some other variable name that is not reserved.
First things first, where are you setting the msbuild path? To resolve your issues, please check if you have followed this process:
Open your system control panel, check for advanced system settings.
Click on Environment variables and edit PATH
Add a semicolon followed by the msbuild path.
Open a new command prompt and check if it is working or not.
Please note if you set msbuild in one command prompt, it will not be available in another command prompt.
Another issue which I see when I look at your logic is, you are trying to cd to %PATH% which should be avoided, you are either resetting the Environment variable path to a new path and trying to cd to it or you will land up file name longer issues, please use another variable instead.
In the bat which you are invoking, add a condition at the root level, such that if msbuild is not found, basing on %ERRORLEVEL%, try adding msbuild to path again at batch level, so that you build will proceed.

ANDROID_HOME environment variable not set error

org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Could not find adb. Please set the ANDROID_HOME environment variable with the Android SDK root directory path.) (WARNING: The server did not provide any stacktrace information)
I have already set my ANDROID_HOME directory to sdk path .
echo $ANDROID_HOME=/Users/xyz/Library/Android/sdk
i still get this error by appium server.Using testNG framework..Running my first app
You need to export tools and platform-tools to access adb command.
If you using mac open then terminal and If you are in windows open .bash_profile
and execute as follows
export ANDROID_HOME=/Users/$(whoami)/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
It looks like it can't find adb from your defined paths. Check if you've added the android platform-tools folder to the $PATH variable. It's the one that contains adb
In your .bash_profile, try adding this line:
export PATH="$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools"
In the above line, I added both the tools and platform-tools folder in the PATH variable.

appveyor - how to set environment variable using %HOMEPATH%

I'm working on a node.js native addon project, instead of using binding.gyp, I'm using cmake, as my project depends on another cmake project.
I can use cmake to build the target(on my own windows 7), which needs to setup environment variables to specify library path include node-gyp and mysql. I got the mysql path(from appveyor doc), please correct me if I'm wrong.
But I don't know how to set node-gyp dir in appveyor environment, which is located in ~/.node-gyp windows equivalent path. I tried below script, and it errored out at NODE_GYP_DIR line.
environment:
# set variables
NODE_GYP_VER: 0.12.7
NODE_GYP_DIR: %HOMEDRIVE%%HOMEPATH%\.node-gyp
LIBMYSQL_INCLUDE_DIR: C:\Program Files\MySql\MySQL Server 5.6\include
LIBMYSQL_LIBRARY: C:\Program Files\MySql\MySQL Server 5.6\lib
My question is, can I assume ~/.node-gyp windows equivalent path exists? How to set the path to my environment variable for my cmake? Thanks!
Use %USERPROFILE% instead:
environment:
# set variables
NODE_GYP_VER: 0.12.7
NODE_GYP_DIR: '%USERPROFILE%\.node-gyp'
LIBMYSQL_INCLUDE_DIR: C:\Program Files\MySql\MySQL Server 5.6\include
LIBMYSQL_LIBRARY: C:\Program Files\MySql\MySQL Server 5.6\lib

wget not recognized as internal or external command

I am working on a program to auto update my game as I make new developments and add new patches. When I go to run the patch update it doesn't recognize wget as a internal or external command.
Game:
:Checkforupdates
cls
cd C:\AirlineSim\
echo Checking for Updates
wget "http://interversesoftware.weebly.com/uploads/4/8/5/8/48585729/aspatcher.bat"
if /i not exist "ASpatcher.bat" (echo Could not retrieve update file.) && pause
if exist "ASpatcher.bat" call "ASpatcher.bat"
if exist "ASpatcher.bat" del "ASpatcher.bat"
goto menu
More code above in the updater
Updater:
cd C:\Airlinesim
echo Updating...
echo.
if /i exist Airline_Simulator.bat" del Airline_Simulator.bat
wget "http://interversesoftware.weebly.com/uploads/4/8/5/8/48585729/airline_simulator.bat")
set version=2.0
wget is a third-party program that doesn't come bundled with Windows, so you need to explicitly install it in order to use it.
You can find (one of) the Windows versions here: http://gnuwin32.sourceforge.net/packages/wget.htm
You will need to add the path of the wget.exe file to your PATH environment variable in order to call the executable as in the batch file above without explicitly specifying the path.
For Windows 10: A good link is available here: https://builtvisible.com/download-your-website-with-wget/
I followed this tutorial-> (https://builtvisible.com/download-your-website-with-wget/) and it worked for me. Still, I will give an overview of that,
credit: Richard Baxter
for 64bit version download wget from here
move your wget.exe to the Windows directory, which is generally c:\Windows\System32.if you don't know then you can find that either using the $PATH command or by opening your cmd as an administrator and in which path it will open that will be your Windows directory. like this one ->
2.1. Check that you have copied that in a proper place or not, to do that restart your cmd/terminal then type wget -h. if it gives some output related to some commands and their utilities(basically what a help command does) then you are good to go👍.
If you pass the above check, then go to your c:/ directory using cd .., then make a directory called wgetdown using md wgetdown. Now you are all set. use get how ever you want.
What this simply means is, wget isn’t installed in your windows machine or it is, but hasn’t been added to Windows environmental path.
If you don’t have wget installed, download it from here (32-bit) and here (64-bit).
Extract the files to a folder say C:\wget and then add the folder to Windows environmental path.
Go to C:\Program Files (x86)\GnuWin32\bin folder and check the .exe file name.
For me it was sid.exe so I'm using sid instead of Wget command
download wget.exe here after downloading, go to command prompt by typing 'cmd' in the search menu, open the cmd type 'path' then enter in the command prompt, you're going to move the downloaded wget.exe to C:\Windows\System32 folder. if its successful, close and open the command prompt and type 'wget -h' then enter you should see different available commands. You can now use 'md wgetdown' to create directory for your downloads
first you have to install wget
pip install wget
than in Jupiter notebook locally on Windows 10
!python -m wget
example
!python -m wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=1InzR1qylS3Air4IvpS9CoamqJ0r9bqQg' -O inception.py
You simply need to install wget from https://anaconda.org/menpo/wget here. I found my solution by installing it.
I had a similar issue, and I resolved it by using Windows PowerShell instead of Command Prompt
The answers about it not being available by default are absolutely correct. A few other notes related to installing wget - if you use a package manager, they may have it for you to install with.. e.g.:
$ choco install wget
$ composer require fawno/wget

Resources