Stats: 3,184,275 members, 7,923,302 topics. Date: Friday, 16 August 2024 at 10:58 PM |
Nairaland Forum / Science/Technology / Programming / Critical Question For Programmer Gurus (2986 Views)
A Question For Yii2 Users / I Am Looking For Programmer That Are Way Smarter Than Me / Interview Questions For Programmer/analyst (2) (3) (4)
Critical Question For Programmer Gurus by Luka316(m): 9:29pm On Jun 06, 2011 |
Hello, I tried to install latest JDK version: jdk1.6 on my windows 7, I have set the Variable in USER VARIABLE as: NAME: PATH Value: C:\Program Files\Java\jdk1.6.0\bin Now, When I went to the CMD and typed "javac"or "java -version to confirm if jdk is properly installed on my system it showed me "java is not recognized as an internal or external command" Now, I am not sure what to do after this? Am I on the right track or doing something wrong? I really want to be able to install this ASAP so I can start using/learning JAVA Programming from very basic. I believe we have capable programmers here Please let me know Thank You |
Re: Critical Question For Programmer Gurus by Nobody: 10:56pm On Jun 06, 2011 |
Try: "C:\Program Files\Java\jdk1.6.0\bin\java -version" at the command prompt. If it works, then the value that you set for PATH is correct and, hence, you need to make certain that you do not have subtle errors like spellings etc; if it doesn't, then Java is installed in the wrong path. On some Windows OS, you'd have to reboot the system for changes made to environment variables to take effect, but I doubt this is the case for Windows Vista and 7. |
Re: Critical Question For Programmer Gurus by SayoMarvel(m): 2:36am On Jun 07, 2011 |
How many partitions do you have on your system? Maybe you mistakenly installed Ȋ̝̊̅† somewhere else. Did you have the command prompt open before setting the path? Such configurations do not take effect until you restart the command prompt. |
Re: Critical Question For Programmer Gurus by Mathics(m): 2:53am On Jun 07, 2011 |
@poster you are almost there¤ while making sure you had made no addressing bl.onder (open the Bin Dir from were you installed your new JDK and simply copy the full address from your windows explorer address bar), include this address again on the path of your user variable. Remember the ";" delimiter. Good luck on your pursuit! |
Re: Critical Question For Programmer Gurus by Luka316(m): 10:46am On Jun 07, 2011 |
@all thx for the reply, my system i have no partition at all, and i have restart my computer still no way, that not withstanding i would still try d sugestion given above. Thx very much, this house is building reboast programmer that would impact nigerian. Thx |
Re: Critical Question For Programmer Gurus by wassolldas: 4:44pm On Jun 07, 2011 |
Open a command prompt window and type the following: echo %PATH% The post the output here. |
Re: Critical Question For Programmer Gurus by Luka316(m): 7:36pm On Jun 07, 2011 |
@wassolldas this is the output from "echo %PATH%" C:\Program files/Java/jdk1.5.0/bin;"C:/Program Files/PC Connectivity Solution/;C:/Program Files/Common Files/Microsft Shared/Windows Live; C:/windows/system32;C:/windows;C:/System32/Wbem;C:/windows/System32/WindowsPowerShell/v1.0/;c:/Program Files/Common Files/Roxio Shared/DLLShrea/;c:/Program Files/Common Files/Roxio Shared/10.0/DLLShared/;C:/Program Files/Common Files/Ulead Systems/MPEG. Sir this is what i get. Pls bear with me, i dont have network on my computer instead i use my phone to reply u with the input. Thx very much, iam expectin to hear form you soon. |
Re: Critical Question For Programmer Gurus by Luka316(m): 7:42pm On Jun 07, 2011 |
@wassolldas(CORRECTED COPY PLS NOTICE THE END OF THE OUTPUT) this is the output from "echo %PATH%" C:\Program files/Java/jdk1.5.0/bin;"C:/Program Files/PC Connectivity Solution/;C:/Program Files/Common Files/Microsft Shared/Windows Live; C:/windows/system32;C:/windows;C:/System32/Wbem;C:/windows/System32/WindowsPowerShell/v1.0/;c:/Program Files/Common Files/Roxio Shared/DLLShrea/;c:/Program Files/Common Files/Roxio Shared/10.0/DLLShared/;C:/Program Files/Common Files/Ulead Systems/MPEG; "C:/Program Files/Java/jdk1.5.0/bin;". Sir this is what i get. Pls bear with me, i dont have network on my computer instead i use my phone to reply u with the input. Thx very much, iam expectin to hear form you soon. |
Re: Critical Question For Programmer Gurus by Luka316(m): 7:58pm On Jun 07, 2011 |
@omo_to_dun i have type in the input u ask me too but it still give me "is not recognized as an internal or external command. Pls sir i need ur help badly, bocs this problem is drawing me back, what should i do next! Pls |
Re: Critical Question For Programmer Gurus by Nobody: 8:19pm On Jun 07, 2011 |
Ah, that means you either do not have Java 1.6 installed or you installed it in some other folder. From the value of your PATH variable above, you can see that there exists no directory for jdk1.6.0. But you do have one for jdk1.5.0 in the folder C:\Program files\Java\jdk1.5.0\bin. Go to this folder and tell us what you see. Simply enter this commands: cd "C:\Program files\Java\jdk1.5.0\bin" dir Also, can you tell us the folder in which you installed the jdk1.6.0? |
Re: Critical Question For Programmer Gurus by Luka316(m): 9:30pm On Jun 07, 2011 |
@omo_to_dun, cd"C:\Program files \Java\jdk1.5.0\bin" dir after inputin this on my command prompt this is what i get " The system cannot find the path specified. The folder i install d jdk is C:\Sun\SDK that is d folder. Sir another issue is that the Sun microsystem is appearin on my star menu( i can even login in), i just check d version on the domain after login, the version said " Sun Java System Application Server Platform Edition 9.0_01(build b14). because the "C:\Program files \Java\jdk1.5.0\bin" i input on d PATH, i got it on d internet(Java website), i dont know if what i put on the PATH is right. sir i know u are willing to help me thank you |
Re: Critical Question For Programmer Gurus by Nobody: 9:56pm On Jun 07, 2011 |
That's the problem! If you installed it in C:\Sun\SDK, then your path should reflect that. Now go to this folder and see if there's a Java folder in it. That is, cd "C:\Sun\SDK" dir If a Java folder is in C:\Sun\SDK, then open it and see which jdk version that you have; for example if you have jdk1.x.y then you will see a jdk1.x.y folder in C:\Sun\SDK\Java; hence, add C:\Sun\SDK\Java\jdk1.x.y\bin to your PATH variable. But why was C:\Program files\Java\jdk1.5.0\bin in your your PATH variable when this folder did not even exist? |
Re: Critical Question For Programmer Gurus by Luka316(m): 10:44pm On Jun 07, 2011 |
That'stheproblem!If youinstalleditinC: \Sun\SDK,thenyour pathshouldreflect that.Nowgotothis folderandseeif there'saJavafolder init.Thatis, cd"C:\Sun\SDK" dir IfaJavafolderisin C:\Sun\SDK,thenopen itandseewhichjdk versionthatyouhave; forexampleifyouhave jdk1.x.ythenyouwill seeajdk1.x.yfolder inC:\Sun\SDK\Java; hence,addC:\Sun\SDK \Java\jdk1.x.y\binto yourPATHvariable.But whywasC:\Program files\Java \jdk1.5.0\bininyour yourPATHvariablewhen thisfolderdidnot evenexist? @omo_to, sir d reason why jdk1.5.0 was there was because i got it form d internet(sun website) sir i have check d folder c:/sun/sdk, the only thing i saw there are addons, bin blueprint docs, javadb, jdk,lib, samples etc i cant see anything like Java within the folder(ie i check it directly thro my C drive not thro command promt) sir as i said above(my previous post) on the login domain of the sun microsystem d version there said "sun java system applictn server paltform edition 9.0_01(build b14) i dont know if this help. God would bless u for helpin me |
Re: Critical Question For Programmer Gurus by Nobody: 11:02pm On Jun 07, 2011 |
the only thing i saw there are addons, bin blueprint docs, javadb, jdk,lib, samples etc i cant see anything like Java within the folder(ie i check it directly thro my C drive not thro command promt)Open this jdk folder and see if there is a bin folder inside it. If yes, tell me what its contents are. I am humbled by your politeness, but I'd appreciate it if you stopped the "God bless you. . ." A simple thank you when the problem is solved should suffice. |
Re: Critical Question For Programmer Gurus by wassolldas: 3:22am On Jun 08, 2011 |
** You should make sure the path you installed the jdk is correct as pointed out by omo_to_dun, You have some invalid characters in your path. You pasted the following: C:\Program files/Java/jdk1.5.0/bin;"C:/Program Files/PC Connectivity Solution/;C:/Program Files/Common Files/Microsft Shared/Windows Live; C:/windows/system32;C:/windows;C:/System32/Wbem;C:/windows/System32/WindowsPowerShell/v1.0/;c:/Program Files/Common Files/Roxio Shared/DLLShrea/;c:/Program Files/Common Files/Roxio Shared/10.0/DLLShared/;C:/Program Files/Common Files/Ulead Systems/MPEG; "C:/Program Files/Java/jdk1.5.0/bin;". But you should remove the quotes, so that it becomes the following: C:\Program files/Java/jdk1.5.0/bin;C:/Program Files/PC Connectivity Solution/;C:/Program Files/Common Files/Microsft Shared/Windows Live; C:/windows/system32;C:/windows;C:/System32/Wbem;C:/windows/System32/WindowsPowerShell/v1.0/;c:/Program Files/Common Files/Roxio Shared/DLLShrea/;c:/Program Files/Common Files/Roxio Shared/10.0/DLLShared/;C:/Program Files/Common Files/Ulead Systems/MPEG;C:/Program Files/Java/jdk1.5.0/bin Close all open command prompt windows after you change the path and open a new one to test. On older versions of Windows OS, autoexec.bat used to be executed to register changes to the path but I don't think that is needed for newer versions of the OS. Windows Operating Systems use the forward slash (\), but backward slash (/) should work fine as well. Change the all the / characters to \ if the java command still does not work. |
Re: Critical Question For Programmer Gurus by Luka316(m): 7:37am On Jun 08, 2011 |
@omo_to, ok sir i would stop "God would Bless" yes sir there is a "bin" inside d jdk folder and this are d content "appletviewer, apt.exe, beqbreg.dll, HtmlConverter.exe, idlj.exe, jar, jarsinger, java, javac, javadoc, javah, javap, javaw, jconsole, jdb,jps,jstatd,keytoo,kinit,klist,ktab,native2ascii,orbd,pack200,packager,policytool, serialver,tnameserv,unpack200" that is d content of "bin" inside d "jdk" folder. Dont give up on me pls |
Re: Critical Question For Programmer Gurus by Luka316(m): 7:44am On Jun 08, 2011 |
@wassolldas, i have done d changes u ask me to, but stil have same problem |
Re: Critical Question For Programmer Gurus by Otuabaroku: 9:59am On Jun 08, 2011 |
Hi Luka316 , you are almost there, just nevigate to the current bin directory using window explorer; then copy the path from address bar of your window explorer and paste it to your classpath; you will be good to go. The classpath will look thus: C:\Sun\SDK\jdk\bin; |
Re: Critical Question For Programmer Gurus by Nobody: 11:34am On Jun 08, 2011 |
Exit the command window if one is open. Add C:\Sun\SDK\jdk\bin to your PATH variable, and open a new command window to test. |
Re: Critical Question For Programmer Gurus by wassolldas: 3:52pm On Jun 08, 2011 |
Remember that all entries on the path variable should be separated by ';' - So add C:\Sun\SDK\jdk\bin; in front of your path variable or ;C:\Sun\SDK\jdk\bin at the back. |
Re: Critical Question For Programmer Gurus by Luka316(m): 9:09pm On Jun 08, 2011 |
@ all, i have input the C:\Sun\SDK\jdk\bin; on my path as asked, but still my test on d command promt(javac or java -version) even after restarting my system still give negative result( is not recognized as an internal or external command) another question is; where i my to input the path, is it on the user variable or on system variables. Pls iam still depending on all of you. I believe with you here this thing most WORK |
Re: Critical Question For Programmer Gurus by Nobody: 10:01pm On Jun 08, 2011 |
If you add it to your system PATH variable, then it will be reflected for all users on your system; otherwise, if you add it to your user PATH variable, it will be reflected for only your own username. Open a command prompt and enter the command: C:\Sun\SDK\jdk\bin\java -version. The above should work and it should tell you the version of your JDK. If it doesn't, then you'd have to reinstall the JDK. If it does, can you give us the content of your PATH variable by running this command: echo %PATH% |
Re: Critical Question For Programmer Gurus by Fayimora(m): 12:41am On Jun 09, 2011 |
is the problem solved?? if no then whats left? |
Re: Critical Question For Programmer Gurus by Luka316(m): 3:00am On Jun 09, 2011 |
yes sir it work and this what it show me after inputin C:/Sun/SDK/jdk/bin/java -version" this is what "java version "1.5.0_09" Java (TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b03) Java HotSpot(TM) Client VM (build 1.5.0_09-b03, mixed mode) while for the "echo %PATH%" this is what i get "C:/Program Files/PC Connectivity Solution/;% CommoProgramnFiles%/Microsft Shared/Windows Live; C:/windows/system32;C:/windows;C:/windows/ System32/Wbem;C:/windows/System32/ WindowsPowerShell/v1.0/;c:/Program Files/ Common Files/Roxio Shared/DLLShrea/;c:/ Program Files/Common Files/Roxio Shared/10.0/DLLShared/;C:/Program Files/ Common Files/Ulead Systems/MPEG; "C:/Sun/SDK";C:/Sun/SDK/jdk/bin; so sir what do i do next, @fayimora iam still under process may be u can check our previuos post, if there is any help ur can rendered, Omo_to_dun and Wassolldas have being great they took me this far. |
Re: Critical Question For Programmer Gurus by Nobody: 6:19am On Jun 09, 2011 |
Make sure that there are no double quotes in the value of the PATH variable: for example, it should look like this C:\whatever\fkdfjjfd;C:\Windows\dfkjfdjfd;C:\Windows\System that is, the directories are only separated by a semi-colon. If this is the case, then I see no reason why java -version shouldn't work since C:/Sun/SDK/jdk/bin/java -version worked. If it doesn't work, then the only advice I can now give is that you would have to prefix your JDK commands with C:/Sun/SDK/jdk/bin/. I hope someone else can better help you. |
Re: Critical Question For Programmer Gurus by Luka316(m): 6:52am On Jun 09, 2011 |
@omo-to-dun, sir it work perfectly well. Thank very much, you dont know how i would take you in my entire journey of learning java(an unknown angel to direct my path) this thing you have done mean everything to me. Thank you once again |
Re: Critical Question For Programmer Gurus by naijaswag1: 5:25am On Jun 10, 2011 |
Luka316: Hey Mr Luka316,I know you feel triumphant that you have got your JVM buzzing,commanding the CLI via your java and javac.Welcome to the world of Java.However,an in-depth understanding of what you have been able to achieve is the only way that you will appreciate your programming experience.In the replies to your post,I can see java programmers confusing PATH and CLASSPATH in windows;however I am going to give you some explanation about these two tools that are key to running your java programs as a newbie.Although it might take you a little time to get used to these things but the right perspective will do you good. Although Java is said to be platform independent and it is,familiarity with the operating system(you use) concepts and behavior will enhance your learning.Lets start with windows.When you open the command prompt windows and type help,it will unleash a plethora of commands that you could use to substitute your GUI(windows widgets).Commands like cd-change directory,md-make directory etc are packaged as .bat files(maybe obscured) and stored in a folder as executables.Now lets try this open a command line(CMD) and type luka316,what do you get,it should be the system cannot find that command.Then lets do something, @echo off echo my name is Luka316 enter the above 2lines and in a notepad using luka316 and save in a folder say C:\nairaland\luka.This means that the saved file shoud be in luka folder.Then go to your my computer if using XP,click view system information-advanced-environmental variables or for win 7 from my computer-advanced settings-environmental variables;then select the Path variable in the system variables and click edit and then add the folder path C:\nairaland\luka; at the end,make sure that there is a semicolon after the last path similar to ours.Then open a fresh command prompt and type luka316.What do you get now? What we have done above is to extend the set of commands that can be run at the CMD by writing a .bat file and directing the system to the path where that command exist.When ever you type a command at the CMD,your windows system scans your Path env variables folders to see if any folder contains the command file and if it does,it executes the contents gracefully.This brings us to setting path for Java and other tools like ant,maven,application servers,databases etc.These development tools and softwares comes with a bin directory that contains executable codes for windows and for you to run these commands like java and javac,you have to extend the in-built windows system commands by letting the OS know the path to the bin directories of these tools when you install then instead you will have to type the complete path to the tool say like C:\Java\jdk1.6.0_25\bin\javac Luka316.java to compile the java file.But if you have set the Path of your Java bin folder by including C:\Java\jdk1.6.0_25\bin in the list of various paths for the OS, you can issue java Luka316.java and the system will look up the Path variable and find the corresponding java bin folder and execute your command. This is what setting the Path variable means.I will talk about CLASSPATH next. |
Re: Critical Question For Programmer Gurus by Nobody: 6:31am On Jun 10, 2011 |
Luka316:You are welcome. naija_swag:Only one programmer(Otuabaroku) made that mistake; please, stop exaggerating! |
Re: Critical Question For Programmer Gurus by Otuabaroku: 9:49am On Jun 10, 2011 |
omo_to_dun:^^^ I laugh in Swahili. I asked him to copy the path of his bin directory(C:\Sun\SDK\jdk\bin) to his CLASSPATH so that it can be seen by other users if he is not the only user of his system. Copying it to the PATH alone will restrict it to himself as a user. So oga omo-to-dun, tell me where I made mistake from what I stated. |
Re: Critical Question For Programmer Gurus by Nobody: 10:39am On Jun 10, 2011 |
Otuabaroku:Wrong! In windows, there are two types of environment variables namely: user variables and system variables. Setting a variable, say PATH, as a user variable will restrict it to the account of the person setting it while setting the variable as system variable(you have to have administrative privileges to do this) will make it available for all the accounts in the system. You set the CLASSPATH when you want the location of your class packages to be known to the JVM. For example, if I have some classes, say Driver.class, Mechanic.class, Person.class, and Test.class in a package edu.caltech which is in turn located in the folder C:\omo_to_dun\nairaland\2011, I can then add C:\omo_to_dun\nairaland\2011\ to my CLASSPATH so that I can import them like so: import edu.caltech.*; If I do not add C:\omo_to_dun\nairaland\2011\ [/b]to my [b]CLASSPATH, then the above import will fail, unless I am currently in the directory C:\omo_to_dun\nairaland\2011. So, stop laughing in Swahili and pick up a good Java Book! |
Re: Critical Question For Programmer Gurus by MrChima2(m): 10:53am On Jun 10, 2011 |
@Otuabaroku LOL. You got owned! |
Re: Critical Question For Programmer Gurus by Nobody: 10:54am On Jun 10, 2011 |
^ Shut up! This is not the romance section, we are all here to learn. |
Get A Custom Website For As Low As 5k (Check Thread For My Portfolio) / Best OS For Programmers / Where Can I Learn Programming In Illorin?
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 72 |