• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Getting started with Java

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is very frustrating, I am trying to set up Java on my computer.  I have bought the Head First Java book and it is supposed to be user friendly but I can't even get the setup done! First just downloading the correct SDK and API documentation is a challenge, there are MANY different versions on the sun website.  I believe I have the correct software downloaded and I can find the documentation but there is no where that I can find to actually download the documentation, just view it.  

The main problem I am having is that I am instructed to unzip or open the software.  It appears to already be open.  Then I am told to add an entry to my PATH environment.  I am at a lost here.  All I can find is info for MAC users on this site.  I am using windows 10.

Any clear advise would be much appreciated!
 
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Donna,
Welcome to CodeRanch!

While that book is excellent, a lot has changed since it was written. Like Oracle buying Sun. This page describes how to install from Windows. I'm not sure how helpful it will be to you, but at least it is a starting point.

The last time I installed on Windows, I just double clicked the .exe file and the JDK installed.
 
Sheriff
Posts: 7125
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This page will also help you get started.
 
Donna Fuga
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the help but I am giving up on installing this.

I am have windows 10 (not really any instructions for this version),  I have set the PATH (I think) but at the command prompt when I type in javac_version I get the following message:
'javac_version' is not recognized as an internal or external command,
operable program or batch file.

Perhaps this is just not my thing. I truly want to learn Java but if I can't even install it....

Even if I ever get this installed how do I use it???
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where did you get "javac_version" from?  

Should be:
javac -version
 
Donna Fuga
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry, yes I used javac -version.  I have posted another post because I believe it has something to do with setting up the path.  I can find no instructions that show anything remotely like what I am seeing in environmental variables.
 
Marshal
Posts: 79707
381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I merged your stuff with the following thread. I hope that is okay by you.
 
Donna Fuga
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, I am really trying but....
I need to be sure the path is setup correctly so that I can compile and run java script from the command prompt. I keep reading how I have to create a HOME_PATH and then edit the path in System variables.  I cannot do this! I am running windows 10.  Below is what I now have in my environment:

User variables

PATH        C:\Program Files\Java|jdk1.8.0_101\bin
TEMP %USERPROFILE%\AppData\Local\Temp
TMP   %USERPROFILE%\AppData\Local\Temp


When I go into path under System Variables and the Edit:

Edit environment variable

%systemroot%/system32
%systemroot%
%systemroot%\system32\windowspowershell\v1.0\
C:\Program Files\Java\jdk1.8.0_101\bin

Could someone please tell me what went wrong?  Thanks.
 
Donna Fuga
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
okay...I keep trying.  Now I am getting the following message when I try to run the compiled file:

'What we need is a critical-pathnetworkedsolution'.


Any help is appreciated.
 
Donna Fuga
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have deleted everything and started again.  I am now able to use my cmd to run java files.  Not sure what was wrong.

Thanks!
 
Bartender
Posts: 1251
87
Hibernate jQuery Spring MySQL Database Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can refer these How To Set The Classpath Or Compiler Problems
 
Campbell Ritchie
Marshal
Posts: 79707
381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Donna Fuga wrote:okay...I keep trying.  Now I am getting the following message when I try to run the compiled file:

'What we need is a critical-pathnetworkedsolution'. . . .

If that is the PhraseOMatic class, that looks as if it were running normally. You have probably forgotten to include spaces in the print instruction.
 
Campbell Ritchie
Marshal
Posts: 79707
381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since you have two threads I shall merge the two and reopen the discussion.
I hope you didn't simply delete things; you shou‍ld uninstall the old version and install the new version. As Jeanne says, simply kick click the installer until something happens, but record what it says about location to install Java® carefully because that will form part of your PATH variable. To work out what to download: this (not demos), at least until a newer update comes out.
 
Campbell Ritchie
Marshal
Posts: 79707
381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I seem to have got the merging right, anyway

If you scroll down the downloads page, you will find a documentation download link, but most people simply use the online version.
 
Donna Fuga
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
everyone here is talking way over my head.  I just deleted the paths in my user and system environment.  I do not know what the HOW TO SET A CLASS PATH link is talking about!  All I want to do is setup the path so that it is easy for me to compile and run apps that I am learning at the command prompt.  I have read everything I can get my hands on, step by step but my screens never match the tutorials.  I finally just deleted the paths and am now having to use the completed file path to access the java file, compile it then use the completed file path to run it. My other option is to download netbeans and use that but I really wanted to do it without the netbean assistance.
 
Donna Fuga
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
one last try...

I went to the Oracle site and for creating the path link it says go to environmental variables and then:

        Set JAVA_HOME:

       a. Right click My Computer and select Properties.


       b. On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, for example, C:\Program Files\Java\jdk1.6.0_02.


I have 2 questions about this instruction:

1. Are they talking about in user variable or system variables?
2. I don't have a JAVA_HOME to edit in either variables (user or system) so how do I edit it?

This is just an example of what I have been reading and trying to do.
 
Campbell Ritchie
Marshal
Posts: 79707
381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Donna Fuga wrote:. . .  I just deleted the paths in my user and system environment.

That sounds disastrous. Restore the system PATH to what it was before you started. Otherwise you might find yourself with other problems with Windows.

I do not know what the HOW TO SET A CLASS PATH link is talking about!

Which CLASSPATH link? I hope nobody has told you to set a CLASSPATH.

All I want to do is setup the path . . . My other option is to download netbeans and use that but I really wanted to do it without the netbean assistance.

Sorry if people are confusing you. As you will find, there are ways to set the PATH with our without setting JAVA_HOME. I think you need JAVA_HOME for Netbeans and some other applications but I am not sure. I had similar difficulties when I started (in those days the books still gave misleading advice to set a CLASSPATH), but once I found out I had to set a PATH, I found the instructions reasonably easy to follow. A lot of tutorials, including the Java™ Tutorials seem to give instructions older versions of Windows, but I don't believe the changes are that great. We have an FAQ of our own which includes how to set the PATH.

It also tells you whether to set some variables as system type or user. If you set them as user type, no other user can benefit from them.
 
Donna Fuga
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Campbell, thanks for the help but I began trying to just set the path. I never found any instructions that I could follow, I do not have the system variables I am told to edit! I was then getting advice like in a recent reply in t his post which gave me a link to class path.

So again I have searched for setting the path, it is of no help. When the path is set (seems impossible...) what does it do for me? Does allow me at the command prompt to just type in for example,  'java hello world' after compiling it and the file will run? Instead of having to type in the complete file path? What is the purpose of setting this path anyway?
 
Sheriff
Posts: 17665
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you google for "setting path in Windows 10" you get some pretty straightforward instructions.
 
Junilu Lacar
Sheriff
Posts: 17665
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The PATH system variable helps the operating system (Windows 10 in your case) find stuff.  You probably know that your hard drive is divided into many different directories. Imagine the hard drive to be something like a big office building, and its many directories like the many floors and rooms in the building, except in this building the rooms aren't numbered based on the floor that they're on, as with most buildings. This building just has random names assigned to each room.  Now, imagine asking someone to find the room named "Scarlet" in a 100-floor building that has 50 rooms on each floor.  It could take a long time to find that room, wouldn't it? Well, PATH is like a list of floors that you would give to the someone, then telling him/her, "OK, don't look in all the 100 floors. Just look for the Scarlet room in the floors that are on this list. If you can find it in one of these floors, then good. If not, just come back here and say you couldn't find it."

So, the PATH on Windows 10 would look something like this: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\

This tells Windows to first look in the %SystemRoot%\system32 directory, then in the %SystemRoot% directory, then in the %SystemRoot%\System32\Wbem directory, and so on when it is asked to run a program. Notice that when you installed Java, it would have installed it in a directory named jdk1.x.x or something like that.  Well, the javac.exe and java.exe programs are in the bin directory under this "home" directory. That's why you'd want to set you JAVA_HOME environment variable to the "home" directory where Java was installed, then add "%JAVA_HOME%\bin" to your PATH variable, so t hat when you type the command to run javac or java, Windows knows to look in that directory for those programs.

Here's another link you might want to check out for instructions: https://www.mkyong.com/java/how-to-set-java_home-on-windows-10/
 
Donna Fuga
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, I understand where to find the system variables, in my previous reply I pasted exactly what my system variables look like. I went to  mkyong link that was suggested here, again it is not what I am seeing! The instructions say append the path to include the java location. How do I append it? When I go into edit the path I can't do it there, (the items I have are shown above). Do  I create a new system variable? Do I just put the it in one of the options I have.
I have wasted enough of everyone's time. I can't seem to explain the issue I am having.
 
Donna Fuga
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am closing this post, really wasting your time.
 
Can you shoot lasers out of your eyes? Don't look at this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic