This week's book giveaway is in the Agile forum.
We're giving away four copies of Head First Agile and have Andrew Stellman & Jennifer Greene on-line!
See this thread for details.
Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

starting out on java  RSS feed

 
Lesley Mashaya
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys i've recently started on java and the books im reading have led me to download the java Sdk. my problem is after downloading the offline file. i installed but cannot seem to access the compiler or javac. i can only see the jmc and a ref docs link. i have done the path thing in control panel but i still dont understand how to open the javac. if anyone can please explain i'd be most thankful as this has given me a headache.

very new to java and coding in general but have basic knowlodge on using a computer.
 
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
You'll find some very useful information here.

You'll know you've got it when you can run "java -version" and "javac -version" from the command line and get back the correct results instead of an invalid command message. The next step is to create a HelloWorld program that you can compile and run from the command line. Use a simple text editor like Notepad++. Do NOT start using an IDE yet.
 
J. Kevin Robbins
Bartender
Posts: 1801
28
Chrome Eclipse IDE Firefox Browser jQuery Linux MySQL Database Netbeans IDE
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to The Ranch!
 
Les Morgan
Rancher
Posts: 768
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are going to want to download an Integrated Development Environment, IDE, to use--NetBeans has been my choice since '99, there is BlueJay and others.

The IDE will facilitate you being able to program easily without having to battle everything right off the bat. You can do some coding and learn as you do. The one thing I always recommend learning ASAP is the debugger that is integrated into your IDE. You will be able to answer more of your questions with a debugger, than you will with most any other way.

Lesley Mashaya wrote:Hi guys i've recently started on java and the books im reading have led me to download the java Sdk. my problem is after downloading the offline file. i installed but cannot seem to access the compiler or javac. i can only see the jmc and a ref docs link. i have done the path thing in control panel but i still dont understand how to open the javac. if anyone can please explain i'd be most thankful as this has given me a headache.

very new to java and coding in general but have basic knowlodge on using a computer.
 
Lesley Mashaya
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Les Morgan wrote:You are going to want to download an Integrated Development Environment, IDE, to use--NetBeans has been my choice since '99, there is BlueJay and others.

The IDE will facilitate you being able to program easily without having to battle everything right off the bat. You can do some coding and learn as you do. The one thing I always recommend learning ASAP is the debugger that is integrated into your IDE. You will be able to answer more of your questions with a debugger, than you will with most any other way.

Lesley Mashaya wrote:Hi guys i've recently started on java and the books im reading have led me to download the java Sdk. my problem is after downloading the offline file. i installed but cannot seem to access the compiler or javac. i can only see the jmc and a ref docs link. i have done the path thing in control panel but i still dont understand how to open the javac. if anyone can please explain i'd be most thankful as this has given me a headache.

very new to java and coding in general but have basic knowlodge on using a computer.


hi this seems to go against all the advice i have been getting on not starting out with the IDE, not to say i dont want to try it but is there a reason you would suggest this since most of my books and forums advice againsts (my books are on Java btw) thanks
 
Lesley Mashaya
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
J. Kevin Robbins wrote:You'll find some very useful information here.

You'll know you've got it when you can run "java -version" and "javac -version" from the command line and get back the correct results instead of an invalid command message. The next step is to create a HelloWorld program that you can compile and run from the command line. Use a simple text editor like Notepad++. Do NOT start using an IDE yet.


hello, i have tried those instructions but to no a
use. as i am at work right now i have come across posts saying i should leave out the "bin" in the directory. i will try that as son as i get home. i am not sure if i put the variables correctly but i think i did and it still didnt work.
 
salvin francis
Bartender
Posts: 1614
36
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do not use an IDE !!!
You are better off learning using a simple text editor than an IDE
 
Lesley Mashaya
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
salvin francis wrote:Do not use an IDE !!!
You are better off learning using a simple text editor than an IDE

thanks for the advice, best not to start on this IDE i see.Your link is a bright light also
 
Les Morgan
Rancher
Posts: 768
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lesley Mashaya wrote:hi this seems to go against all the advice i have been getting on not starting out with the IDE, not to say i dont want to try it but is there a reason you would suggest this since most of my books and forums advice againsts (my books are on Java btw) thanks


It is very simple: you need to be able to learn Java and how to program. Right now you are caught up into the mechanics of getting the JDK setup and you're getting frustrated doing it. Wait until you get a hold of a simple Text editor and try to get javac and the debugger to work with it, you are headed for some real frustration.

I have taught a few dozen people Java in a corporate environment where we expect them to come up to speed rapidly and know what is going on--not putz around being frustrated while trying to get things working so they can develop inefficiently on a Text editor and have the other programmers having to debug their code because they cannot get the Debugger to work.

The IDE will be your best friend--context sensitive help, access to the API docs, auto complete typing, integrated debugger, style templates, and etc. It is a rapid development toolkit with all the tools you need to develop. Don't get me wrong, there are things you need to learn like what a class path is, and how to use your debugger, and where your java compiler is and how to use it stand alone, what a JAR file is and to make an executable JAR, and etc. You should not get bogged down in all the manual stuff when you are learning Java, you just don't need the distraction.

Now there are some real gotcha's with IDE's too. Several of the IDE's have code generators--using these to start off with is a horrible idea. They will do what makes sense to them, and it will lead you down a path that you will not be able to recover from in your project development. When I see auto generated code, and somebody is having problems with it, especially newbies, I tell them go back and design the project and code it by hand and don't touch that auto code generator again. In over 20 years of programming, I have not found a code generator that is worth using--beginning is definitely not the time to use auto generated code.

Save yourself a lot of frustration and get the IDE now, but also learn what is in the books about doing it manually as you have a curiosity and time to do so.
 
Lesley Mashaya
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Les Morgan wrote:
Lesley Mashaya wrote:hi this seems to go against all the advice i have been getting on not starting out with the IDE, not to say i dont want to try it but is there a reason you would suggest this since most of my books and forums advice againsts (my books are on Java btw) thanks


It is very simple: you need to be able to learn....


thank you for the explaination. will look into this and decide what's best.
 
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
Les Morgan wrote:
It is very simple: you need to be able to learn Java and how to program. Right now you are caught up into the mechanics of getting the JDK setup and you're getting frustrated doing it. Wait until you get a hold of a simple Text editor and try to get javac and the debugger to work with it, you are headed for some real frustration.

I couldn't disagree more. What you call frustrating, I call essential learning. It's vitally important that a beginning programmer learn how to compile and run a Java program from the command line. Please read our IdeFaq
Les Morgan wrote:
The IDE will be your best friend--context sensitive help, access to the API docs, auto complete typing, integrated debugger, style templates, and etc. It is a rapid development toolkit with all the tools you need to develop. Don't get me wrong, there are things you need to learn like what a class path is, and how to use your debugger, and where your java compiler is and how to use it stand alone, what a JAR file is and to make an executable JAR, and etc. You should not get bogged down in all the manual stuff when you are learning Java, you just don't need the distraction.

Here you give contradictory advice. You say using an IDE is vital, yet you also say that learning the very things that the IDE insulates you from is also vital.
Les Morgan wrote:
Save yourself a lot of frustration and get the IDE now, but also learn what is in the books about doing it manually as you have a curiosity and time to do so.

Another contradiction. This just confuses the greenhorns. I really think that advising new programmers to jump into an IDE is very bad advice. They are for experienced coders, not beginners.
 
Campbell Ritchie
Marshal
Posts: 55793
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome again

Agree with the advice to get a text editor. But not Notepad; if I have the misfortune to have to use Windows® I use Notepad++. Also make yourself a java (or similar) folder from the command line: more details here.
 
salvin francis
Bartender
Posts: 1614
36
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Windows® I use Notepad++.

Just wanted to share .. When i started learning java in college, we wernt allowed to install any applications in the computer and notepad was not to my liking (especially with tabs).
I used to use Dos's edit.com to do so just because it maintained tabs when pressing enter. Alas, its no longer shipped with windows...
Copy and paste were Control+Insert and Shift+Insert back then
 
Stephan van Hulst
Saloon Keeper
Posts: 7821
142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've always been a fan of UltraEdit, because it keeps indentation and it auto-completes all words that I have written in the file before, which means that after declaring some variable I can write it very quickly by typing one or two letters and then hitting enter.

I can enable my IDE to auto-complete identifiers, but UltraEdit does it for all words I have written before, and it does so without skipping a beat. Sadly, it's not free. Notepad++ is my second choice when I'm not working with an IDE.

 
Sonam Chawla
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you need to install the JDK properly and then set the path in Environment Variable. After proper setup go to cmd and then write javac, somefiles will run it means java is installed properly in your system. For more information and to Know the Step by Step Process --> How to Install and Run the Java Programs click here
 
Oluwasanmi Aderibigbe
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have not setup your JAVAPATH. you can Google how to setup javapath for your pc
 
Campbell Ritchie
Marshal
Posts: 55793
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sonam Chawla wrote:. . . Step by Step Process --> How to Install and Run the Java Programs[/b] . . .
Not a very good tutorial; our FAQ is better.
 
Campbell Ritchie
Marshal
Posts: 55793
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oluwasanmi Aderibigbe wrote:You have not setup your JAVAPATH. . . .
You do not normally use that particular environment variable. Please don't introduce such red herrings.
 
Les Morgan
Rancher
Posts: 768
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
J. Kevin Robbins wrote:
Another contradiction. This just confuses the greenhorns. I really think that advising new programmers to jump into an IDE is very bad advice. They are for experienced coders, not beginners.

Kevin,

While there are a lot of things that coders and programmers need to learn that are not in an IDE, I absolutely disagree with the idea of "start out with stone knives and bear skins" type of approach. I learned that stone knives and bear skins approach and taught that for several years until we really looked at what we wanted and expected from our programmers. With an IDE the person is able to get in and follow the tutorials from day 1 and not have to go through all the frustration of learning the "essentials". Is there a place for the manual stuff--yes, there is. Is it at the very beginning? No, it is not.

Just as we do not advocate programmers making your own queue, stack, linked lists, trees, and etc, and in many instances programmers now never learn anything about those structures except how to use them, the same is true for what, at one time, was the essential way to program Java--the stone knives and bear skins approach. The IDE is an integrated collection of tools that allow rapid development and learning for the beginner as well as the old pro. I have seen the difference in time taken to bring programmers up to speed using both methods and in my book, get the IDE out and install it and be going the minute after it completes the install.

Should a programmer know how to setup and use the compiler? Absolutely. Should it be a prerequisite from learning Java? No. Should they know the library system for classes in the API? Yes. Do they need to learn it all before they are able to program? No. Is it essential for a person to effectively debug? Yes. Does that mean they have to do it with println's in a Text Editor or with the Stand alone debugger? No. Upon these points and others we will have to agree to disagree. Much research and development has gone into those IDE's since the 90's, where the stone knives and bear skin philosophies hold over from, and I have to say: it is much better to use the IDE and become proficient at the tools therein right from the start, than to throw away 20 years of progress to learn how to setup and run javac and use a text editor for programming.

I have been running programmers around the block for more than a couple decades now, and the "stone knives and bear skins" is just not an economical way to teach a person to program in a language.

Les
 
Lesley Mashaya
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
J. Kevin Robbins wrote:You'll find some very useful information here.

You'll know you've got it when you can run "java -version" and "javac -version" from the command line and get back the correct results instead of an invalid command message. The next step is to create a HelloWorld program that you can compile and run from the command line. Use a simple text editor like Notepad++. Do NOT start using an IDE yet.
hello, the link you put there really helped, explains better i suppose. thank you. now for this hello world adventure.
 
Jaypee Hernandez
Greenhorn
Posts: 14
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you should download Java in 24 hours a day, it's free in pdf format and then you should start using IDE because you need to cope up with what's new in order to take advantage in your programming. Many people say we should not use IDE in the first coding but I also respect the thought because it will make you understand the inner concepts of what is behind that IDE-ish thing, but after you already know the basics in that old fashioned programming, you better start immediately with IDE so that the needed tools will be already there and so you will be ready to code in no time without setting up first a separate code editor, opening command line utilities, setting paths, etc, etc. Once you know how to use java without IDE (just the basics), you should immediately switch to IDE, like BlueJ is excellent for beginning programming in Java, and then Eclipse for me is a great IDE tool for java programming because of its features, it is open source and had many plugins for you to choose from. I hope this helps. Thanks!
 
Campbell Ritchie
Marshal
Posts: 55793
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaypee Hernandez wrote:. . . download Java in 24 hours a day
Disagree. There may be several books with similar names, but I don't consider the one I have seen at all good.
. . . code in no time without setting up first a separate code editor, opening command line utilities, setting paths, etc, etc.
That bit is mistaken. You will have to set a PATH before using an IDE anyway. It is quicker to configure a text editor and open the command line than to configure an IDE.
. . . like BlueJ is excellent for beginning programming in Java . . .
I have used BlueJ myself and the scars have just about healed now. It is good for teaching the concepts behind objects, but once you start writing whole apps, then BlueJ will get in the way. I recommend you avoid it. If you are going to use an IDE get a decent one. That means Eclipse NetBeans or IntelliJ.
 
Les Morgan
Rancher
Posts: 768
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've done NetBeans since '98 or '99 and it has always been self contained at startup if you have installed the JDK first. When you want to run outside of the IDE though, you may have to do some of the manual stuff to get the paths set properly. And do not use the code generator--it's a gotcha waiting to happen and all you need for it to happen is to use it.

Campbell Ritchie wrote:
Jaypee Hernandez wrote:. . . download Java in 24 hours a day
Disagree. There may be several books with similar names, but I don't consider the one I have seen at all good.
. . . code in no time without setting up first a separate code editor, opening command line utilities, setting paths, etc, etc.
That bit is mistaken. You will have to set a PATH before using an IDE anyway. It is quicker to configure a text editor and open the command line than to configure an IDE.
. . . like BlueJ is excellent for beginning programming in Java . . .
I have used BlueJ myself and the scars have just about healed now. It is good for teaching the concepts behind objects, but once you start writing whole apps, then BlueJ will get in the way. I recommend you avoid it. If you are going to use an IDE get a decent one. That means Eclipse NetBeans or IntelliJ.
 
Campbell Ritchie
Marshal
Posts: 55793
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to set the PATH first before NetBeans will work. If you want a particular convention, e.g. number of blank lines between successive methods, you may have to reconfigure NetBeans.
 
Les Morgan
Rancher
Posts: 768
19
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep, I go in and edit the Editor defaults and the default template to be what I want each time I forget and delete the entire package before installing the new one. I have been, surprisingly, quite fortunate in that the JDK has setup the path correctly since the first day I've installed--now the class path is something entirely different, but NetBeans does not seem to be effected by it once you set the JDK usage. But when you get out of the IDE and try to run your new Project JAR, you may suffer from classpath problems and have to set them.

Campbell Ritchie wrote:You have to set the PATH first before NetBeans will work. If you want a particular convention, e.g. number of blank lines between successive methods, you may have to reconfigure NetBeans.
 
chris webster
Bartender
Posts: 2407
36
Linux Oracle Postgres Database Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree that it's probably best to start out with a basic programmer's editor (Notepad++, SublimeText etc) initially, so you can get familiar with all the wiring that's involved in getting a simple Java program to run - class path, compilation, jar files etc.

But if you think you might prefer the comforts of an integrated development environment (IDE), then you might want to look at Mark Dexter's video tutorials on Eclipse and Java for beginners. You can also view the videos on YouTube. These are a bit old now, but the core features of Eclipse haven't changed much, and these videos are a great way to get started with the various features of an IDE, and to find out how Eclipse automates some of the tasks that you would have to do manually if you start out with a text editor. It's important to have some understanding of what the IDE is doing underneath, because it will go wrong eventually and you'll need to know where to start looking for the problem.

And if you really have no idea yet what an IDE is/does, check out the first couple of videos just to see what it all looks like, and decide if you want to start simple with an editor or start fancy with an IDE.

There are several IDEs that are commonly used for Java - Eclipse seems to be the most widely used in my experience, but NetBeans and IntelliJ are both popular as well. All of these have been around for many years, are well documented, and they all do much the same things, so it's not too hard to switch from one IDE to another if you want to. Most commercial Java developers end up using an IDE in their work, although often the specific IDE will be decided by their employer e.g. to make it easier for people to share code and working environments. So it will be useful for you to learn how to work with an IDE eventually, but you don't have to do it as your first step into Java.

Good luck, and have fun!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!