Unable to launch sparkR shell in spark-1.4.0 - sparkr

I downloaded Spark-1.4.0 today and tried to launch the sparkR shell both in Linux and Windows environments - the command sparkR from the bin directory is not working. Anyone successfully launched the sparkR shell, pls. let me know.
Thanks
Sanjay

I can help you with the setup for Windows. unfortunately, i do not know about Linux.
My solution was as follows which I have also posted on my blog
The one limitation of this solution is that it works only on the command line interpreter meaning you can invoke sparkR from command prompt but not from using any front end IDE like RStudio. I’m still trying to figure out how to get sparkR working on RStudio.
The trick is to ensure that you set the environment variables correctly. I’m using Windows 7 HP edition 64 bit OS. First step is to download Maven, SBT
Set the variable name as `JAVA_HOME (in case JAVA is not installed on your computer then follow these steps). Next set the variable value as the JDK PATH. In my case it is ‘C:\Program Files\Java\jdk1.7.0_79\’ (please type the path without the single quote)
Similarly, create a new system variable and name it as PYTHON_PATH. Set the variable value as the Python Path on your computer. In my case it is ‘C:\Python27\’ (please type the path without the single quote)
Create a new system variable and name it as HADOOP_HOME. Set the variable value as C:\winutils. (Note: There is no need to install Hadoop. The spark shell only requires the Hadoop path which in this case holds the value to winutils that will let us compile the spark program on a windows environment.
Create a new system variable and name it as SPARK_HOME. Assign the variable value as the path to your Spark binary location. In my case it is in ‘C:\SPARK\BIN’
Create a new system variable and name it as SBT_HOME. Assign the variable value as the path to your Spark binary location. In my case it is in ‘C:\PROGRAM FILES (x86)\SBT\’
Create a new system variable and name it as MAVEN_HOME. Assign the variable value as the path to your Spark binary location. In my case it is in ‘C:\PROGRAM FILES\APACHE MAVEN 3.3.3\’
Once all these variables have been created, next select the “Path” variable under “System variables” and click on the Edit button. A window called “Edit System variable” will pop up. Leave the Variable name “Path” as it is. In the variable value, append the following string as given
%Java_HOME%\bin;%PYTHONPATH%;%SPARK_HOME%;%HADOOP_HOME%;
%MAVEN_HOME%\bin;%M3_HOME%\bin;
'
Click on Ok button to close the environment variable window.
Now open up the terminal (the command prompt window) and invoke pysparkR by typing the command pyspark. If you want to invoke scala then the command is spark-shell
Hope this helps.
Cheers

Related

Maven isn't installing properly

I've tried everything I could find on this topic, yet I'm not able to install Maven.
I'm at the following point:
I have java installed
I unzipped the files from the apache website
I have set up environment variables and added requirement parameters to the path (had to use the escape character in the path, because of the space in Program Files folder name: C:\Program^ Files\apache-maven-3.6.3)
what could be the problem?
cmd
From the attached image all requirements are OK. Try one of those two solutions:
Close the CMD window and reopen it (if you didn't this already).
Restart your computer in in order to apply the environment variables you've just added.

JMETER_HOME environment variable is not defined

I tried to execute JMeter 4.0 from the command prompt in Windows 7.
I got the following error during execution:
The JMETER_HOME environment variable is not defined correctly This
environment variable is needed to run this program
I set C:\apache-jmeter-4.0\bin to JMETER_HOME variable, but the problem remains
I can start JMeter with its jar file.
I use jdk1.8.0_162 and set JAVA_HOME environment variable correctly.
You should set JMETER_HOME to main JMeter directory as C:\apache-jmeter-4.0
Also don't set JMeter directory to JAVA_HOME variable (should hold Java installation path)
Ensure you have installed Java and JMETER Gui works fine first.
Then,
At User Variables add JMETER_HOME followed by D:\Jmeter (Where Jmeter is installed)
Next select Path in User variables and add D:\Jmeter\bin(Where Jmeter bin path is)
Save and restart cmd.
P.S: This is for Windows solution
First ensure you've Java installed
Second you need to ensure the working directory of your call is the JMeter installation directory.
Assumption your JMeter installation is located under:
C:\Program Files (x86)\apache-jmeter-4.0
then you need to set this as working directory.
As you can read in the jmeter.bat file itself:
JMETER_HOME - installation directory. Will be guessed from location of jmeter.bat
This might sound obvious, but I'm getting this error on machines that don't have Java installed. Of course, though a better message might have been nice!
Easiest way:
just delete the JMETER_HOME environment variable, run jmeter.bat and variable will be added automatically.
Asually a wrong JMETER_HOME entry causes this. make sure you have JMETER_HOME pointed to jmeter folder not inside bin directory. For example ,from my local windows i am able to see this thie environment variable
Type : echo %JMETER_HOME%
For me, setting the Windows environment variable didn't help. Instead it worked when I set the variable at the command line (using the root folder of jmeter).
Like this:
SET JMETER_HOME=C:\apache-jmeter-4.0
ensure java is installed and can check with java —version
assuming the path jmeter installed is C:\apache-jmeter-5.3
add the user variable
press new
add Jmeter variable name as JMETER_HOME
variable value as: C:\apache-jmeter-5.3
add the path
look for Path system variable and press edit
edit it to have C:\apache-jmeter-5.3\bin
it doesnt have Path(very unlikely), than press new and add variable name as path and value as C:\apache-jmeter-5.3\bin
restart cmd and type jmeter should do the job.
One reason for getting this error is to have JMETER_HOME variable defined in the environment variables but pointing to the wrong location. I had this problem due to previous installation.
You don't need to set JMETER_HOME path explicitly under user variables, just add/change under system variables under path variable as your bin path. If you already have earlier version of JMeter just append with latest version. Path looks like : C:\XXX\apache-jmeter-4.0\bin

Maven 3.0.5 installed in Windows 7 but not able to run through command prompt

As per suggestions given in this site i have added the required variables and values as below too but no response
JAVA_HOME=C:\Program Files\Java\jdk1.7.0_25
M2=%M2_HOME%\bin
M2_HOME=C:\Program Files\apache-maven-3.0.5-bin\apache-maven-3.0.5\bin
PATH=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%M2_Home%\bin
Please help me
Your path configuration has a M2_Home instead of M2_HOME. It should be all uppercase
%M2_HOME%
Also notice, you are specifying bin twice, should
M2_HOME=C:\Program Files\apache-maven-3.0.5-bin\apache-maven-3.0.5
I had same situation multiple times, i.e. configured M2_HOME as user env variable and added it to PATH (system env variable), i.e.
PATH=%M2_HOME%\bin; ...
However sometimes (randomly) Windows don't resolve variable in path, run "echo %PATH%" in your console. In my case I can still see %M2_HOME% there instead of resolved path to maven installation directory. It seems to be a bug in Windows itself, which is present in WinXP and Win7 at least.
I have resolved it as follows:
Open env variables, change M2_HOME (user one) to correct value. Press OK to save and close window
Open env variables again, now open PATH (system one) variable details, make sure M2_HOME is there and press OK, i.e. just save without any modification.
Now, open command line and check "echo %PATH%" - there should be resolved path. Confirm by running "mvn --version".
I know it really sounds like a black magic, but it should work...

Apache Maven installation in windows 8

I followed steps mentioned in this link http://maven.apache.org/download.cgi
Whenever I type mvn --version in cmd.
I got 'mvn' is not recognized as an internal or external command, operable program or batch file.
But when I opened cmd with "Run as a administrator" it worked.
OS: windows 8
How can I run mvn for any user on windows 8.
Try setting the environment variable M2 as System variable instead of User variable.
I used Rapid Environment Editor, started as an Administrator, and put these variables into my System path, and this problem went away.
For some reason, when I added the the JDK, JRE, and Maven bin folders to my Path through the Windows utility, it didn't work. Rapid Environment Editor told me that the variables were not valid or I did not have access to them. Windows 8 seems to be really picky about administrator rights and I guess they didn't think that through very well.
Just be sure to start Rapid Environment Editor as an administrator, and re-open your command windows when you save your changes.
I had to move the installation directory of Maven into C:\Users*your_username*, so that Maven no longer required admin permissions. The PATH variables started working after that.
Set the MAVEN/M2 and MAVEN_HOME/M2_HOME variables in the environment variables in windows 8, this will solve the problem.
I'm using chinese version so that i'm not sure what's these word in english version.
click right button on "My computer"
click last item on list
click "Advanced system setting" at left side
"Evironment Variable"
append maven's bin directory into system's environment variables path
after all, try linux
The simplest way is:
Add maven directory to the path in systems variable.
don't add anything in user variable and no need to add any variable.
faced the same problem; The bins or files from path for M2_home and Java_home need to be found in a directory where the user has full control permission. Change the security permission settings of the user through the administrator by right click on the order, go to properties->security tab and check the Full control box for "authenticated user" and "user".

‘ant’ is not recognized as an internal or external command

I have the same issue as this user: ant - not recognized as an internal
however unfortunately none of the solutions have worked for me in that post or any other. I've also looked at other commands not recognized and specifically adding a path variable. The procedure I am using is as follows:
Extract to a desired installation directory, e.g. C:\apache-ant
Create an ANT_HOME environment variable`
Open System Properties -> Advanced -> Environment Variables
Create a new system variable
Variable name: ANT_HOME
Variable value: C:\apache-ant
Add %ANT_HOME%\bin directory to the PATH system variable
Open System Properties -> Advanced -> Environment Variables
Under system variables, select PATH and append ;%ANT_HOME%\bin
e.g. %SystemRoot%\system32;%SystemRoot%;%JAVA_HOME%\bin;%ANT_HOME%\bin
Verify that ANT is installed.
Open a new command window and type:
C:\>ant -v`
In my case the Variable value is C:\apache-ant\apache-ant-1.8.2.
My exact path variable is %SystemRoot%\system32;%SystemRoot%;%JAVA_HOME%\bin;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%JAVA_HOME%\bin;%ANT_HOME%\bin which doesn't have any spaces between semicolons.
However testing the ant installation does not work, the picture below is what I'm experiencing:
I have tried restarting on numerous occasions to no avail. I have run out of ideas, so if anyone has any any information would be helpful. Thanks!
EDIT
Posted results of dir:
ANT_HOME is not being resolved. Change %ANT_HOME%\bin in the Path system environment variable to c:\apache-ant\apache-ant-1.8.2\bin.
I had a similar issue, but the reason that %ANT_HOME% wasn't resolving is that I had added it as a USER variable, not a SYSTEM one. Sorted now, thanks to this post.
create a script including the following;
(replace the ant and jdk paths with whatever is correct for your machine)
set PATH=%BASEPATH%
set ANT_HOME=c:\tools\apache-ant-1.9-bin
set JAVA_HOME=c:\tools\jdk7x64
set PATH=%ANT_HOME%\bin;%JAVA_HOME%\bin;%PATH%
run it in shell.
When Environment variables are changed log off and log in again so that it will be applied.
I downloaded ant (http://ant.apache.org/bindownload.cgi), unzipped to my C drive, and used the windows 'doskey' command:
doskey ant=C:\apache-ant-1.9.6\bin\ant.bat $*
this will work as long as you use the same command console, to make it permanent is more difficult: http://darkforge.blogspot.com/2010/08/permanent-windows-command-line-aliases.html
Please follow these steps
In User Variables
Set VARIABLE NAME=ANT_HOME VARIABLE PATH =C:\Program Files\apache-ant-1.9.7
2.Edit User Variable PATH = %ANT_HOME%\bin
Go to System Variables
Set Path =%ANT_HOME%\bin
Had the same problem. The solution is to add a \ at the end of %ANT_HOME%\bin so it became %ANT_HOME%\bin\
Worked for me. (Should be system var)
even with the environment variables set, I found that ant -version does not work in scripts. Try call ant -version
Need to see whether you got ant folder moved by mistake or unknowingly.
It is set in environment variables.I resolved this once as mentioned below.
I removed ant folder by mistake and placed in another folder.I went to command prompt and typed "path". It has given me path as "F:\apache-ant-1.9.4\".
So I moved the ant back to F drive and it resolved the issue.
If none above helped anyone...My issue was that I was trying to use ant -version on a cmd prompt that I had already opened before I added apache-ant to the path.
As the cmd prompt was using the PATH it had when it was opened and not the new one (that had apache-ant) it wasn't finding it.
Opening a new cmd and running ant -version showed me I actually did have it installed correctly.
I got same problem , what I did for fix :
Open system environment variable
Click on environment variable
in user varaible -> edit path and then add C:\FolderWhereYouInstalled\ant\ant_1.8.4\bin
Click ok
Open cmd and type : ant -version
thanks, might help someone :)

Resources