Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

trouble installing JDK

 
rohit rusty
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I started learning java a couple of days ago. I am referring to 'Head First Java'. Here I have

- downloaded and installed jadk1.6.0_26
- i have set path = c:\program files\java\jdk1.6.0_26\bin

That's the only far i can get. And i have the following questions:

1. Is that all? Or any further steps are needed? If any, please mention what are they?
2. Where to write the source code? Is word pad fine?
3. Where to save the source code?
4. While compiling (at cmd prompt) it does not recognise "javac". How to compile then?
Thankyou for your help in advance.

Regards,
Rohit
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Since javac is not recognized it means the path for the binary files (java, javac) are not correctly set.

Set path by
Right click MyComputer -> Advanced Tab -> Environment Variables ->Edit Path under System Variables...

Say if it is currently like -> C:\Program Files\Common Files\Microsoft Shared\Windows Live;%SystemRoot%\system32;... blah blah blah

You concatenate your Java installation (till bin) separated by semicolon to the first like -> C:\Program Files\Java\jdk1.6.0_17\bin; C:\Program Files\Common Files\Microsoft Shared\Windows Live

Now open a fresh cmd prompt and give java command and ensure java is recognized by the path set.

I think Notepad/Wordpad will be very good for beginners than learning from IDE... lets confirm this from others from the forum...

I will advise you to save your source code in a separate folder you create C:/JavaTrials/ .... and have the path pointed to in the cmd prompt..

Welcome to ranch
 
KayCee Clark
Greenhorn
Posts: 13
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on what beginner means. If you have never coded before in any language, then probably notepad, at least for a while.

Some feel that using an IDE leads to poor learning.

I personally feel that an IDE, like Eclipse ( free download ) is a good tool for beginners because it provides immediate feedback - - - - rather than delayed feedback of a compile. Immediate feedback is supposed to reinforce learning better than delayed feedback. The trick is, you have to make an effort to learn from and understand the feedback and any suggested resolutions - - - don't just let the IDE do some of the work for you. And, the IDE does not always make the right decision or deduction. Nor can it always know that you intend to write another line of code that will silence it's objection. So you have to understand when to ignore it - - - again - - - a learning opportunity.

There is a little overhead in installing and learning how to use the IDE. So, if you are not one with the time or patience for that, then Notepad is probably the way to go.

And you should still make a point of learning to use the tools from the command line.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note Notepad, please. Nor WordPad. download Notepad2, Notepad++, jEdit or similar. You will see how much better they are for programming than Notepad.
 
rohit rusty
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks a lot guys that was helpful. As suggested

- I created a separate folder for saving source file named 'javatrails'
- and has added C:\javatrails\; to the path variable.
- I'm using word pad to write the source code and saving it with '.java' extension in the folder 'javatrails'.

But the issue is yet not completely resolved as i type " javac file_name.java"
It gives the folowing error:

javac:file not found: file_name.java
usage: javac <options> <source files>

Regards,
Rohit
 
Kuldeep singh ranbanka Rathore
Greenhorn
Posts: 13
Chrome Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi rohit..
to get rid off this problem, you should go to that folder within command prompt in which your .java files are saved
i.e. do it as follows.
type in command prompt as it opens
cd cd:\javatrails\ press enter.
and now type javac file_name.java
now it is done..
n i also think that notepad will be good for beginners as i also use notepad.
 
Dic scott
Greenhorn
Posts: 17
Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Rohit,
Hope your issue is resolved. As suggested, with jdk you need to include its path to system variables.
If you downloaded Netbeans7.0 + jdk 1.6 bundle, you wouldn't have run into the issue of setting up the path to system variable. But you wouldn't have got the opportunity to learn fundamentals of java installation.
This problem of ignoring simple stuff grows bigger with more usage of IDE . As you arer a java beginner Notepad or Notepad++ is highly recommended
This habit helps a lot during interviews as you will be tested on your syntax knowledge aswell. With IDE everything is already on your plate. So you won't be able to learn the syntax.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kuldeep singh ranbanka Rathore wrote: . . . i also think that notepad will be good for beginners as i also use notepad.
That's only because you have never tried NotePad2 por NotePad++

And welcome to the Ranch
 
Kuldeep singh ranbanka Rathore
Greenhorn
Posts: 13
Chrome Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:
Kuldeep singh ranbanka Rathore wrote: . . . i also think that notepad will be good for beginners as i also use notepad.
That's only because you have never tried NotePad2 por NotePad++

And welcome to the Ranch


thaks . i'll try these ones..
 
jake dickens
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kuldeep singh ranbanka Rathore wrote:
Campbell Ritchie wrote:
Kuldeep singh ranbanka Rathore wrote: . . . i also think that notepad will be good for beginners as i also use notepad.
That's only because you have never tried NotePad2 por NotePad++

And welcome to the Ranch


thaks . i'll try these ones..



just use notepad ++ you can set the exec as the file your learning from and saving it but to solve the problem with javac not being recognized is by setting the user environment to path as name and location of java eg. C:\program files\java\java_jdk_1.6.25\bin.
 
rohit rusty
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks a lot guys, all your suggesions were really helpful......thanks a lot!

Regards,
Rohit
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic