• Post Reply Bookmark Topic Watch Topic
  • New Topic

PATH Environment Variable Issues  RSS feed

 
Franklin Marquette
Ranch Hand
Posts: 49
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey peeps of Java! I recently purchased Head First Java and am a complete beginner in programming having only completed a few courses on codeacademy. The book first tells the reader to add an entry to your PATH Environment variable that points to the /bin directory in the main JAVA directory which is my Java SDK. The purpose of this is so when I type %javac in the command line - my terminal will know how to find the javac compiler.

Like I said I am an EXTREME beginner - so PLEASE bear with me.

I thought this meant change the value of the PATH environment variable to the location of the /bin directory - I was too late to notice that it meant to ADD the location of it - or ADD something anyway - so....

Q #1 - Is there any way to get back the original value of the PATH environment variable - because I screwed a few systems up by deleting it
Q #2 - What am I actually supposed to add to the PATH Environment's value to make it do what its supposed to do and why do i do that?
Q #3 - What does the PATH Environment variable do?
Q #4 - What is a command line?
Q #5 - What do they mean by "terminal"?

THANKS sooooo much for the help!!
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try by going through our FAQ about running your first program. If there are any questions not answered, please ask.
What is your current PATH?
If you are running Windows® try start→all programs→accessories→command prompt and give it the following instruction:-
echo %PATH%
Tell us what the output is.

And welcome to the Ranch
 
Franklin Marquette
Ranch Hand
Posts: 49
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It says C:\Program Files\Java\jdk1.7.0_40\bin
 
Franklin Marquette
Ranch Hand
Posts: 49
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
with a semicolon(;) on the end.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If that's the only thing in your PATH environment variable, then that's not good. At Q1 you wrote you've screwed up a few systems by deleting it. Normally there should be a whole list of directories in the PATH, if you've removed them all your system might not work properly anymore...

You have to add the bin directory of the JDK to the path (do not replace the whole PATH with the bin directory of the JDK. So, in the end, it has to look like:

<... whatever was there previously ...>;C:\Program Files\Java\jdk1.7.0_40\bin

(if you've installed the JDK in C:\Program Files\Java\jdk1.7.0_40).

Q2/3: Windows uses the PATH variable to find programs to run, especially when you use the Windows command prompt. Search the web for "Windows command prompt tutorial". Oracle's Hello World tutorial shows you how to use a text editor and the command prompt to compile and run your first Java program.

Q4: command line = Windows command prompt
Q5: terminal = the Linux / Mac OS X version of the Windows command prompt
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure how to restore your original PATH. What sort of programs have stopped working?
 
Franklin Marquette
Ranch Hand
Posts: 49
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Roxio Creator Starter was not able to start up - I fixed this by uninstalling it and reinstalling it. The only other issue I have experinced is a missing file - which I fixed by installing dll file fixer and reinstalling the file. Other than that nothing else has happened.
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of Windows are you running? At the least, the path should include the windows folder and the system32 folder (i.e. c:\windows;c:\windows\system32;)
 
Franklin Marquette
Ranch Hand
Posts: 49
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Windows 7 Professional
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
J. Kevin Robbins wrote:What version of Windows are you running? At the least, the path should include the windows folder and the system32 folder (i.e. c:\windows;c:\windows\system32;)


Agreed. It is probably a good idea to add the Windows system and system32 folder back on the path. Otherwise, you will be unable to run many of the commands in Windows.

Franklin Marquette wrote:Roxio Creator Starter was not able to start up - I fixed this by uninstalling it and reinstalling it. The only other issue I have experinced is a missing file - which I fixed by installing dll file fixer and reinstalling the file. Other than that nothing else has happened.


This seems to be a bit of an overkill to me. It was probably easier to look for the binary files, via a search, and likely under the program files directory, and add the bin directory back on the path.

Henry
 
Franklin Marquette
Ranch Hand
Posts: 49
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They have been added to the PATH

At that point I did not know that it was because my PATH variable's value was deleted - and that was what Dell Support said - it was after that happened that I found out about the PATH issues.

THANKS!
 
Campbell Ritchie
Marshal
Posts: 56546
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done sorting it out I hope there aren't any more problems.
 
Franklin Marquette
Ranch Hand
Posts: 49
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So do I

THANKS!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!