Author |
Message |
revangrey
|
|
|
|
|
Sponsor Sponsor
|
|
|
Zren
|
Posted: Tue Mar 30, 2010 10:49 pm Post subject: RE:Programming in Notepad with cmd |
|
|
Probably didn't set the Class_Path (it's option 4 and is labeled optional but it's required if you want to easily compile from cmd). Normally you have to type:
C:\Program Files (x86)\Java\jdk1.6.0_18\bin\javac.exe [file your compiling]...
However you can set a variable for Windows to look in a specific folder for executables.
Control Panel > System
Advanced Tab/Option > Environment Variables
Under System Variables, find PATH. Edit it. At the end of it, place a semicolon ( ; ). Then find your install of the JDK, it'll look something like this:
C:\Program Files (x86)\Java\jdk1.6.0_18\bin
Make sure your select the bin folder since that's where javac.exe is. |
|
|
|
|
|
chrisbrown
|
Posted: Tue Mar 30, 2010 10:53 pm Post subject: Re: Programming in Notepad with cmd |
|
|
First, kudos for getting down and dirty; you'll learn much more this way.
From the ccsu site:
Quote: If you see the following
[...]
The name specified is not recognized as an
internal or external command, operable program or batch file.
then the PATH environment variable has not been set correctly.
How to fix this
In this case, you want to add the directory that javac.exe is located in, something along the lines of C:\Program Files\Java\jdk_something\bin. You may need to use "Program Files (x86)". |
|
|
|
|
|
revangrey
|
Posted: Tue Mar 30, 2010 11:08 pm Post subject: Re: Programming in Notepad with cmd |
|
|
Completely my fault for not being specific enough...
I tried using the java in both the Program files and the Program files (x86) folder, and I didn't have anything called "PATH" to edit in system...
the "C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip" in QT java looked like the closest thing to java there already (also what led me to try (x86))
I also tried C:\Program Files\Java\jdk1.6.0_1\bin
C:\Program Files (x86)\Java\jdk1.6.0_18\bin\javac.exe (this one I made a new variable "PATH" since there was not one already"
I will go over what I have done and try some more combinations, but I dont think I made any mistakes...
Thanks the help though! |
|
|
|
|
|
Zren
|
Posted: Tue Mar 30, 2010 11:23 pm Post subject: RE:Programming in Notepad with cmd |
|
|
Can you find your installation of the JDK in explorer? What folders are in C:\Program Files (x86)\Java\ ? |
|
|
|
|
|
Tony
|
Posted: Tue Mar 30, 2010 11:53 pm Post subject: Re: Programming in Notepad with cmd |
|
|
revangrey @ Tue Mar 30, 2010 11:08 pm wrote: but I dont think I made any mistakes...
revangrey @ Tue Mar 30, 2010 11:08 pm wrote: I didn't have anything called "PATH" to edit in system... |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
revangrey
|
Posted: Wed Mar 31, 2010 12:06 am Post subject: Re: Programming in Notepad with cmd |
|
|
I put that path there... I really have no idea what you mean...
I didn't delete one if that is what you are insinutating?
You should probably just spell out for me what it is you are thinking to clarify (I really don't understand...)
and in response to previous :
In the C:\Program Files(x86)\Java\ I have
and in the C:\Program Files\Java I have
and javac is in the bin folder of the Program Files, and x86 bin folder.
Also I probably won't have time to try out anything new until later this afternoon (after school), but any advice posted until then is much appreciated! |
|
|
|
|
|
Zren
|
Posted: Wed Mar 31, 2010 12:17 am Post subject: Re: Programming in Notepad with cmd |
|
|
Delete the variable javac, it's of no use. Delete the PATH variable for your account if you made it (the top section, not system). Not entirely sure but the latter could override the system (though it could easily also just add to it).
Path C:\Program Files (x86)\Java\jdk1.6.0_01\bin
In both the Path variables in the screenshot you forgot the red.
If PATH doesn't work, try Path. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
chrisbrown
|
Posted: Wed Mar 31, 2010 12:20 am Post subject: RE:Programming in Notepad with cmd |
|
|
In your PATH value, are you including javac.exe? If so, remove it; PATH should be a directory, not a file. |
|
|
|
|
|
revangrey
|
Posted: Wed Mar 31, 2010 6:55 pm Post subject: Re: Programming in Notepad with cmd |
|
|
I tried path and PATH, both after deleting the javac.exe part and ending at "bin".
...unfortunately this did not work, but something interesting happened to any new cmd windows that I opened
Most commands that I would use every day "calc", "mspaint", "notepad", and that fancy one up above don't seem to work on any but the first command prompt window...
I think this means that my new path additions prevent cmd accessing it's own commands.
just a theory... (I am quite lost)
Also sorry for being such a hassle |
|
|
|
|
|
chrisbrown
|
Posted: Wed Mar 31, 2010 7:35 pm Post subject: RE:Programming in Notepad with cmd |
|
|
Look at your PATH variable. It should have a list of semicolon-seperated directories.
From the looks of it, a reference to system32 was removed or damaged. Try setting your path to this and see what happens:
code: | %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Java\jdk1.6.0_01\bin |
Just so it's clear, the purpose of setting that is so you don't have to type the full path to javac. Instead of "C:\.....\javac.exe fileName", you can just use "javac fileName". |
|
|
|
|
|
Tony
|
Posted: Wed Mar 31, 2010 7:58 pm Post subject: RE:Programming in Notepad with cmd |
|
|
Looking at your screenshots, just a note: spaces are used to separate arguments.
That is, if you type in
>C:\Program Files\...
Then "C:\Program" is the command, and "Files\..." is the argument.
(This is why programmers don't like spaces and join_words_with_underscores)
To fix that, use quotation marks, or escape characters. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
DemonWasp
|
Posted: Thu Apr 01, 2010 12:49 am Post subject: RE:Programming in Notepad with cmd |
|
|
Alternately, you can use dir /X to list the "short" name of the file (8.3 format). These never include spaces. On my system, Program Files (x86) is PROGRA~1. Windows will expand this path to the "real" path automagically. |
|
|
|
|
|
revangrey
|
|
|
|
|
|