• 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
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to set up Java environment as in Head First Java?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I made the changes to my path but when i write a code it shows always shows 'file not found'. How do i set it up? I'm confused.
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

Please explain the full details, including where you are putting your code, how you are invoking it at the command line, etc. Please copy and paste all the commands and error messages. When we know all that information, then we can help.
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please be careful when you change your path. You can break all kinds of things if you don't do it right.

on you command line, type this:

echo %path%

and look to see if the directory to your java install is there. If you are not sure, paste what you get from that here.
 
Nissim Nabh
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@fred: Ya its in my path.
@campbell: I edited my path file, after installing jdk 1.8, to its bin directory. Then i make an app from notepad and save it as 'AnyApp.java'. It gets saved as a JAVA file as it should and not as a text file. Then from the command line, i try to compile it with the command, 'javac AnyApp.java', but it shows an error saying, 'File not found'. I have saved the app on my desktop. What am I doing wrong?
java1.PNG
[Thumbnail for java1.PNG]
Code written in Notepad
java2.PNG
[Thumbnail for java2.PNG]
AnyApp has been saved correctly as a .java file
java3.PNG
[Thumbnail for java3.PNG]
The command prompt screenshot
 
Ranch Hand
Posts: 624
9
BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In command prompt, change the directory to desktop. Then execute the command to compile.
Or you can do like

I presume "Desktop" directory is under "C:\Users\Praanjali"
 
Campbell Ritchie
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't use the desktop, unless you want thousands of .java files cluttering your screen.
You will find what I usually suggest in this old post.
 
I like you because you always keep good, crunchy cereal in your pantry. This tiny ad agrees:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic