I'm trying to install Leiningen in order to install Overtone.
Following the directions for installing Leiningen, I:
Installed JDK7u25
Installed leiningen 2.2.0
Can't get any further because:
When I run lein.bat, I get this message: "Error: Could not find or load main class' and -that's the end of the error message.
This happens when the computer runs the following batch file command:
"%LEIN_JAVA_CMD%" -client %LEIN_JVM_OPTS% ^
-Dclojure.compile.path="%DIR_CONTAINING%/target/classes" ^
-Dleiningen.original.pwd="%ORIGINAL_PWD%" ^
-cp %CLASSPATH% clojure.main -m leiningen.core.main %*
I've checked the environment variable for the location of java.exe and the path for leiningen\bin and they are both correct.
Both the Java installation and leinginen installation look fine: everything seems to be there and be in the right places.
When I rem out the #echo off in the batch file, the console output shows that the paths used for both java.exe and leiningen-2.2.0-standalone.jar are correct. The only odd thing to a windows user is the -Dclojure.compile.path, which is "E:\Documents and settings\<myname>\.lein/target/classes" -- the 2 forward slashes "/" cannot be part of any windows path, but maybe they may make sense to java.
I'm new to all this stuff. Is there something missing from the instructions that's so obvious it wasn't included? Or is the problem just with me or my system.
Thanks for any help or ideas.
You need to fix the lein.bat file.
Line 27: Put quotes around the variable setting for LEIN_JAR, so:
if "x%LEIN_JAR%" == "x" set LEIN_JAR="!LEIN_HOME!\self-installs\leiningen-!LEIN_VERSION!-standalone.jar"
That should get lein running, it still throws up an error "no such command and" but I expect that is the same issue later in the .bat file. Lein still runs however.
Leningen 2.2.0
I am working on windows XP.(ONLY FOR WINDOWS XP)
I tried all the suggestion above, but it didn't work.
Error: Could not find or load main class
The problem is with spaces in path.
I found a different workaround
Download lein.bat from http://leiningen.org/
there is no need to edit lein.bat
create a directory in c:\lein\bin (DON'T USE "C:\Documents and Settings\Administrator\.lein")
Put lein.bat in c:\lein\bin\lein.bat
Put c:\lein\bin in your "enviroment variable" PATH
Put c:\lein in your "enviroment variable" LEIN_HOME
from cmd run lein self-installs
This command download the file in "C:\LEIN\self-installs\leiningen-2.2.0-standalone.jar"
Use lein repl to start
A simple workaround is to move the .lein folder to C:\lein and set environment variables properly
move "%userprofile%\.lein" c:\lein
set LEIN_HOME=C:\lein
set PATH=%PATH%;C:\lein\bin
then you can run
$lein repl
Related
While running the following command prompt I am getting the error as in the screenshot.
Command:
c:\spark>spark-shell
Error:
'""C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Why?
Suprit,
The issue is most likely with the space in your JAVA_HOME.
If the path contains spaces, use the shortened path name. For example, C:\Progra~1\Java\jdk1.8.0_131
If you are using Windows10. please try the below
Set JAVA_HOME as "C:\Progra~1\Java\jdk1.8.0_131"
Also make sure you have included %JAVA_HOME%\bin in your PATH environment variable.
I suspect that you installed Java to a directory with a space so JAVA_HOME breaks spark-shell script on Windows.
Make sure you install Java to a directory with no space in the path.
The other option would be to set JAVA_HOME to the same value but wrapped with double quotes, e.g.
set JAVA_HOME="C:\Program Files\Java\jdk1.8.0_131"
That will likely lead to the other issue on Windows that was answered in Why does spark-shell fail with "was unexpected at this time"? that's simply to re-install Java to a directory with no space in the path.
The thing I could not check out yet would be to wrapped JAVA_HOME using single quotes (not double quotes). That in theory would help pass the line with comparison to "x".
First you gotta find out where is your JAVA_HOME. In my case it is, "C:\Program Files\Java\jdk1.8.0_25\bin\java"
Then open your file called spark-class2.cmd, locate and change to your java home path (change only the bold text below).
Additional text are included for completeness only.
"C:\Program Files\Java\jdk1.8.0_25\bin\java" -Xmx128m -cp "%LAUNCH_CLASSPATH%" org.apache.spark.launcher.Main %* > %LAUNCHER_OUTPUT%
for /f "tokens=*" %%i in (%LAUNCHER_OUTPUT%) do (
echo %%i
set SPARK_CMD=%%i
)
del %LAUNCHER_OUTPUT%
%SPARK_CMD%
I had same issue. I uninstalled java and installed in C:\Java folder , changed the required env settings and it just worked for me!!!
I had the same problem.
It happens with version spark-2.1.1-bin-hadoop2.7 but not with the previous version spark-2.1.0-bin-hadoop2.7.
Edit line 54 of spark-2.1.1-bin-hadoop2.7/bin/spark-class2.cmd by removing the quotes as:
set RUNNER=%JAVA_HOME%\bin\java
Then it should work.
Somewhere you have set a path or variable without wrapping it in double quotes. Hence the path is being split on the first space.
C:\Program Files\Whatever
has become...
C:\Program
To fix it you need to make sure you wrap path variables in double quotes.
i.e
C:\Program Files\Whatever\Foo\My Bar\bin
should be
"C:\Program Files\Whatever\Foo\My Bar\bin"
or even better use environment variables for user paths. e.g.
"%PROGRAMFILES(X86)%\Whatever\Foo\My Bar\bin"
"%PROGRAMFILES%\Whatever\Foo\My Bar\bin"
You need to set the Environment variable to use spark-shell from any directory.
Or you need to go inside bin folder to execute spark-shell command
in my case its inside /spark/spark-2.0.2-bin-hadoop2.7/bin/
I was getting same error after set all path.
So you have type Space spark-shell
c:\spark> spark-shell
it will work
Follow to my step
Download JDK 8 for windows
Install Java Development envioronment
Download Spark with latest version with prebuilt Hadoop
Download WinRar for extracting
Make folder in C derive put spark folder
Go to Conf folder in Spark
Change format of log4j.propreties
Open Log4 .. in word
Replace INFO to Error
Save that file
Download Winutils
Create new folder as Winutils in C derive
Paste download winutils file in bin folder
Set Environment in Windows
Control Panel
Click on System and Security
System
Advance System Setting
Environment variables
( Set Spark Home)-New
New User_ Variables Form
Variable _Name- SPARK_Home
Path:- C:\Spark ( Spark foder in C derive)
(Set Java Home )- New
JAVA_HOME
Java Folder path –(1st java folder)
Set Hadoop path –
HADOOP_HOME
Path- C:\Wintulis
Path Directories
PATH- Edit
New- %SPARK_HOME%\bin
NEW- %SPARK_HOME%\bin
System Environment Done
You have to set the path of spark in the environment variables by following this or any other tutorials.
Another option is to go into the directory that contains the spark-shell and execute it directly.
Hope this help, Best Regards
I downloaded apache-tomcat-7.0.40 for Windows 8 and I followed the instructions by using the C:\apache-tomcat-7.0.40> startup.bat at my command prompt. The tomcat application appeared for 1 second and then disappeared, so I maybe the documents installation is not enough?
What should I do? While my local host is internet information service.
In command prompt run below command, you will get the root cause.
...\apache-tomcat-7.0.42\bin> catalina.bat run
In my case it was because I run catalina.bat start and this command creates new command prompt, while catalina.bat run executes in the same command prompt and doesn't close it after finishing.
Try to remove the slash at the end of CATALINA_HOME variable path.
Catalina needs JAVA_HOME to work properly. So configure path to java jre and JAVA_HOME in environment variables.
To see the error, in command prompt execute
\path\apache-tomcat-6.0.41\bin > catalina.bat run
Go to your tomcat/bin folder. Edit startup.bat file, comment out last but one line which says:
call "%EXECUTABLE%" run >..\logs\OutputFile.log 2>&1 start %CMD_LINE_ARGS% run >..\logs\OutputFile.log 2>&1
comment out using 'rem' beginning of it.
rem call "%EXECUTABLE%" run >..\logs\OutputFile.log 2>&1 start %CMD_LINE_ARGS% run >..\logs\OutputFile.log 2>&1
then Console will be remain open. if this line is commented then that means it says to close the console and write the output in some external log file.
Your problem is, most likely, wrong path of the CATALINA_HOME environment variable.
Answers above would help, but I will add one point, which would be more extensive as it may help for different kind of exceptions connected to server startup, and namely - to CATALINA_HOME.
In the late versions of Tomcat, You actually do not need to set environment variable CATALINA_HOME. If you'll have a look inside start startup.bat, the script sets it itself upon each execution.
[23-30] lines of the script in Tomcat 9:
rem Guess CATALINA_HOME if not defined
set "CURRENT_DIR=%cd%"
if not "%CATALINA_HOME%" == "" goto gotHome
set "CATALINA_HOME=%CURRENT_DIR%"
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
cd ..
set "CATALINA_HOME=%cd%"
cd "%CURRENT_DIR%"
So, just to be safe that your environment variable doesn't mess up with something defined by Tomcat script startup.bat (or anything else), you can either:
Remove your CATALINA_HOME environment variable entirely, as long as you start your server with startup.bat;
Correct your environment variable CATALINA_HOME path if you insist to be starting it otherwise, and make sure, nothing overrides it during run-time.
I am trying to run sqlite from the command prompt.
So I have this downloaded sqlite-shell-win32-x86-3071100.zip from this website http://www.sqlite.org/download.html
Now there is a set up.exe from which v can run sqlite commands.
When I say
C:\Users\..>'sqlite3' is not recognized as an internal or external com
''sqlite3'' is not recognized as an internal or external command,
operable program or batch file.
Any hints.
Thank you
Sun
From your windows command prompt, you can start sqlite3 either with:
cd c:\Stuff
sqlite3.exe
or with:
c:\Stuff\sqlite3.exe
Either way, I assume from your comment that sqlite3.exe is in c:\Stuff.
As Michael mentioned, you can also add the path of the directory containing sqlite3.exe to your PATH. Fro a quick search I found this guide: http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx
I assume that you already have sqlite in your system path since the instructions on how to do this are clear.
The likely problem is that you have created a folder called sql3 and have put the three executable files in a folder within that folder.
Check that all three executable files are within the file itself.
Go to an environment variable and add new environment variable C:\sqlite as I have saved the sqlite3 files under sqlite folder of C drive. It worked for me
It maybe possible that when u have extracted files from the downloaded zip folder,2 folders are created of the same name one inside the other. So in the cmd prompt u have to enter that folder 2 times by using .
E.g-C:....\sqlite-tools-win32-x86-3330000\sqlite-tools-win32-x86-3330000
and then use sqlite3
If your sqlite3.exe is in C:\Stuff, you can check really quick to see if it's in your PATH.
echo %PATH% will give you your full path. If you don't see ;C:\Stuff there (probably near the end), that's why windows can't find sqlite3.exe.
If you don't see it, run:
setx path "%PATH%;C:\Stuff"
That should be problem solved. Open a new command prompt (it only updates PATHS when the terminal opens), run echo %PATH% and you should now see ;C:\Stuff at the end.
Congrats. sqlite should work in the terminal moving forward.
I have installed ActivePerl on my Windows OS. I have followed below URL
procedure to install
ActivePerl Installation
After having done that, I have tried to run "perl -v " on the command line. But it reports the following error.
The system cannot execute the
specified program
What do I need to do to solve these issues?
I was facing a similar issue... but the thing was that I could execute the file by right clicking the file and opening it with perl command line interpreter.... but still the perl-v command would give the error... all I had to do was execute this command
set PATH=C:\Perl\bin;%PATH%
This solved the issue...
You need to make sure the directory where the Perl executable lives (it might be C:\perl\bin, but basically wherever you told ActiveState Perl to be installed) is in your PATH environmental variable (you can find the variable value by typing set PATH command on command line prompt in Windows).
If you're not sure where you installed Perl to (and can't find it in the default C:\perl\bin), you can find the directory by going to Start menu, finding ActiveState Perl folder, and right-clicking on "Perl Package Manager" icon, then pick "Properties" from the right-click menu. Properties window (in the "Shortcut" tab) will have a "Target" line showing the directory.
I was getting a similar error after installing ActiveState Perl on Windows 8 x64 bit edition and trying to invoke 'perl' at the command line.
'perl' is not recognized as an internal or external command, operable
program or batch file.
I remember selecting the option during installation to add the Perl directory to the system PATH environment, and after checking the system properties, it was indeed showing in the system PATH.
I tried installing 'Microsoft Visual C++ 2008 x86 and x64 redistributable setup' files as suggested by a few places but it still did not resolve the issue, until I tried some of the suggestions in this thread.
At the command prompt I entered:
set PATH
And surprisingly it did not list the Perl directories as being included in the PATH variables.
So to remedy that I entered this into the command prompt and hit enter:
set PATH=C:\Perl64\bin;C:\Perl64\site\bin;%PATH%
(The directory paths are for the 64 bit edition of Perl, adjust according to your installation) the %PATH% portion is important and ensures your existing settings are kept and not wiped out and overwritten when you set the PATH.
That fixed it and entering 'perl -v' into command prompt successfully replies your Perl version. If you had a PowerShell window open before setting the PATH variable, you will need to close it and re-open another instance of PowerShell.
I believe the original underlying issue was something to do with different PATH variables for 32-bit and 64-bit environments and possibly some internal Windows redirection that takes place automatically.
This doesn't sound like a problem with PATH - I would expect it to give the message 'perl' is not recognized as an internal or external command, operable program or batch file.
I have not seen this error message, but http://nirlevy.blogspot.com/2008/03/system-cannot-execute-specified-program.html makes some suggestion for related programs.
Or maybe ask on an Active State forum.
I had the same error. I was able to solve it by changing the order of the Perl64 entries in the PATH variable in the Environment Variables. I moved the C:\Perl64\bin to be before C:\Perl64\site\bin and it worked.
I had a similar error which was solved by adding the .pl extension to the script name, which I had forgotten to do.
I could not get it to work otherwise even with my Perl's location (C:\Apps\Perl\bin) verified as in %PATH%.
The problem lies in the installation directory.
The Perl PATH variable will be set to C:\Program Files\perl (depends on 32 or 64 bit of course), BUT, the default installation directory is C:\perl. This is kind of sneaky actually as you would assume the installer would be more intelligent about this, but it sets the environment variable to that directory no matter WHERE you install the damned thing.
I am trying to compile a java source file via a Ruby Script. However I am a bit puzzled by the following behavior
compile_results = `javac #{source_file}`
this fails to run with a 'No such file...' error. I popped up irb
irb(main):001:0> `javac -help`
Errno::ENOENT: No such file or directory - javac -help
from (irb):1:in ``'
from (irb):1
irb(main):002:0> `csc`
=> "Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.3053\nfor Microsoft
(R) Windows (R) 2005 Framework version 2.0.50727\nCopyright (C) Microsoft Corpo
ration 2001-2005. All rights reserved.\n\nfatal error CS2008: No inputs specifie
d\n"
However both javac and csc are on the PATH. e.g. if i run javac manually from the shell that I run the ruby script from, I am able to get to the java compiler.
The source file exists.
I tried both ruby 1.8.7 and 1.9.1 (Windows). Does anyone see something that I am missing ?
Update:
I dont think it has to do with command line args. Rather it can't get to javac for some weird reason. I put the line javac %1 in a batch file and call the batch file in the usual way. This worked... but still am not sure of what the whole issue was with javac.
An obvious difference between the two is that you're not running csc with an argument.
Just to get closer to the solution, write a JavaHelp.bat (or .cmd if you prefer), put it on the path and call that from ruby.
Another thing you could try is to call java explicitly as javac.exe . I don't have much hope in that, though, as csc without .exe works too.
Finally, you could try interposing your own shell: Try something like
cmd /c javac -help
(In all this, I'm assuming you're on Windows).
It seems that Ruby on Windows doesn't like the
`command -with-args`
syntax. You might try
%x[javac -help]
or
%x[javac #{source_file}]
or
system 'javac', '-help'
or
system 'javac', "#{source_file}"
Javac may be in your shell's path but as far as Ruby is concerned in this instance it isn't. Csc clearly is in your path and gives you errors as it should but javac doesn't.
If you just run javac does it give you the same ENOENT? If so it's just a path problem. It's entirely possible that your environment in Ruby is different from that in the shell. Can you print out your environment and make sure that the path is actually correct?
Lastly, I don't know if they still use it, I've not used java in ages, but doesn't java have a different path system? I seem to recall you have to set JAVA_HOME or something instead of the path (or in addition to in case the path fails?).
Been a while since I last used windows, apologies if these are all dead-ends.
Do this instead:
`C:/java_location/bin/javac.exe arguments`
And replace the C:/Java_location with the actual location of the JDK. This should work, and you won't need an additional batch file.
Here are a couple of possible reasons:
source_file have spaces somewhere in
its name or path. Quote argument to javac.
source_file is a relative path, but
you cannot get to that relative path
from you current working directory.