DEV Community

Discussion on: Installing and Running Hadoop and Spark on Windows

crashbandavid profile image
David Camilo Serrano

Hi,
Here it is my path:
C:\Users\David Serrano>echo %path%
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Microsoft MPI\Bin\;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files\Java\jdk-12.0.1\bin;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Progra~1\Java\jdk-12.0.1;C:\BigData\hadoop-3.1.2;C:\BigData\hadoop-3.1.2\bin;C:\BigData\hadoop-3.1.2\sbin;

As you can see, there are a lot of spaces, however, in the cofngiuration f the variables i am using--> C:\Progr~1 ... in order to avoid spaces problems. But, the problem is with my user "David Serrano". The error says:

Error: Could not find or load main class Serrano
Caused by: java.lang.ClassNotFoundException: Serrano

As you can see in the PATH there is not "Serrano" word. so, my conclusion is that the problem is in my user. But i don't know how i can to avoid this.

Thread Thread
awwsmm profile image
Andrew (he/him) Author

Maybe it's doing something with your working directory path? Try cd-ing to C:\ first, then running Hadoop. I'm really not sure, though.

Thread Thread
crashbandavid profile image
David Camilo Serrano

I already did that:

C:>hadoop version
Error: Could not find or load main class Serrano
Caused by: java.lang.ClassNotFoundException: Serrano

Do you know which script of hadoop call the user profile? do you know if hadoop has some way to set up the name of the user profile in the scripts?

Thread Thread
awwsmm profile image
Andrew (he/him) Author

I don't, sorry, David. I'm not sure why that should be hard-coded anywhere, if it's not in your %PATH% and you're not in that directory.

Thread Thread
crashbandavid profile image
David Camilo Serrano

Well, here are some info (although it is a little bit old) that could give some clue about the problem:

blog.benhall.me.uk/2011/01/install...

I think i can do something similar to the advice in the above blog. However i need to know which is the variable that hadoop is using to call java in order to change it in the config files.
If you have some info about it, please post here in order to try to solve the problem.
Thanks in advance.

Thread Thread
awwsmm profile image
Andrew (he/him) Author

Hadoop uses JAVA_HOME to determine where your Java distribution is installed. In a Linux installation, there's a file called hadoop/etc/hadoop/hadoop-env.sh. It might be .cmd instead of .sh on Windows, but I'm not sure.

Check out my other article on installing Hadoop on Linux. (Search for "JAVA_HOME" to find the relevant bit.)

Thread Thread
crashbandavid profile image
David Camilo Serrano

Yes, the JAVA_HOME variable is fine in my laptop. However, hadoop must use in another part of its code the variable %USERNAME% or %USERPROFILE%. Those variables are the problematic thing. I need to locate that part in hadoop and try to change in some config file (if it is possible). Actually i have another machine with ubuntu and hadoop works normally. The idea was installing on windows to do some specific work in both systems.

I appreciate your attention, and if you get some new info about this kind of problems (user name with spaces and yarn problems in windows) please don't hesitate in posting it here.

thanks a lot.

Thread Thread
patilpranay619 profile image
Pranay

Hey Guys, I am also the same problem in my system due to space in my system user name >Did You find any Solution
thanx in advance