• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

The system cannot find the path specified

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, hope someone can help me.

I have the Java Development Kit downloaded in my C file and my book tells me to compile the program I need to open command windowand change the directory where the program is stored. I tried the command cd to change directory and received this message "The system cannot find the path specified."

I checked the Environment Variables on Windows 7 and the Path says: C:\Program Files (x86)\Java\jre1.8.0_31\bin

This is after many tries and i still can't change directory and i keep getting the same message.

The book I am using to learn Java is "Java How to Program: Tenth Edition" from Paul and Harvey Deitel. Maybe someone knows what my issue is here and can help me?

Thanks
Devin
 
Ranch Hand
Posts: 789
Python C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you need to change the current directory to where your java file is? For starters the easiest thing might be to copy your java file to the root directory "c:\" and then in the window enter cd \
The compiler will look for the java file in the directory it was started from and find it there in c:\

Also from the command window, Windows sometimes doesn't like spaces in paths even though Windows creates paths with spaces. If you have a space you might try a \ or a / in front of the space, That works in linux but I haven't used Window in a long time.

 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In windows, putting quotes around a path should make it work.
I am paranoid enough that I take no chances, and install Java into: C:\java rather than under "C:\Program Files\Java..."

Another trick you can do with the command line is to use "auto complete"
Type the first few characters of the path, and then hit 'tab' if it finds a match it should fill in the rest of the directory name for you, and you can then type the next layer

so type: "cd c:\pro" and then 'tab' --> cd "\Program Files"
type "ja" and then 'tab' --> cd "\Program Files\Java"
...

Try just typing "java -version" at the command prompt. If prints out your java version, you know you have it installed correctly.

Then try typing "javac -version"

You listed a path to a JRE which is the java runtime. That won't let you compile java programs. For that you need a full JDK and the javac (java compiler) (check out the Beginners FAQ for an explanation



 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Devin Small wrote:I need to open command window and change the directory where the program is stored. I tried the command cd to change directory and received this message "The system cannot find the path specified."


That means you're trying to cd to a directory that doesn't exist.

Open a command prompt.
Type dir and press <Enter>
Type the cd command you've been using; you should get the same error ("The system cannot find the path specified.")
Click the icon at the top left of the Command Prompt window
Select Edit > Select All
Press <Enter>

Paste the result here (UseCodeTags <- that's a link)
 
Devin Small
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Darryl Burke wrote:

Devin Small wrote:I need to open command window and change the directory where the program is stored. I tried the command cd to change directory and received this message "The system cannot find the path specified."


That means you're trying to cd to a directory that doesn't exist.

Open a command prompt.
Type dir and press <Enter>
Type the cd command you've been using; you should get the same error ("The system cannot find the path specified.")
Click the icon at the top left of the Command Prompt window
Select Edit > Select All
Press <Enter>

Paste the result here (UseCodeTags <- that's a link)




 
Bartender
Posts: 8320
71
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try

And see which command fails
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Devin Small wrote:I have the Java Development Kit ...

I checked the Environment Variables on Windows 7 and the Path says: C:\Program Files (x86)\Java\jre1.8.0_31\bin


It looks like you have only installed the Java Runtime Environment (JRE) and not the Java Development Kit (JDK).
 
Devin Small
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Carey Brown wrote:Try

And see which command fails



It failed for \examples and the rest below.
 
Marshal
Posts: 26697
81
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Surely your book didn't expect that those directories would already be on your computer? Didn't it tell you to create them, or something like that?

Anyway the only problem you're having is that those directories don't exist. Create them and you'll be fine.
 
Darryl Burke
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Carey Brown wrote:Try

And see which command fails


You do realise that the first line won't do anything, don't you?
 
Carey Brown
Bartender
Posts: 8320
71
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Darryl Burke wrote:

Carey Brown wrote:Try

And see which command fails


You do realise that the first line won't do anything, don't you?


The first line doesn't to anything if you happen to already be on the C: drive. I put that in there to guarantee that he is in fact on the C: drive.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic