guys,i am just a java newbie and i am really interested in studying this.i am currently using java development kit 5 and i am working on the exercises in sam java 24 hours. cant get to compile Saluton.javabecause when i am trying to typejavac Saluton.java in the ms-dos commandlineits giving me 'javac' is not recognized.....how can i solve this one?also, where can i find online tutorials for dummies like me in java?hope you could help me with this.your help will be very much appreciated.thanks!

Dani AI

Generated

Short diagnosis and what it usually means: the error you reported most often happens because the Java compiler (javac) isn’t available to the command shell. Either a JDK (which contains the compiler) isn’t installed, only a JRE is present, the JDK’s bin folder isn’t on your PATH, or you’re not running the command from the folder with your source file. The compiler and the runtime are different pieces — the compiler comes with the JDK. (oracle.com)

Quick checks to run from a new Command Prompt (open a fresh window after any changes):

java -version
javac -version

If javac prints a version you’re good; if not, look for a JDK install directory and check its bin folder for javac.exe. Also make sure your prompt’s current directory is where the .java file sits (use cd to move there) before compiling. The Java tutorials show this simple verify→compile→run workflow. (docs.oracle.com)

How to fix PATH on Windows (short): add the JDK’s bin directory to the system or user PATH via System → Advanced → Environment Variables → Path → Edit (or temporarily in the shell with set). After editing, close and reopen the Command Prompt so the change takes effect. If you only installed a JRE, install a JDK from a trusted vendor instead. The platform docs cover the exact steps and the reason why reopening the shell is required. (java.com)

About the IDE vs command-line debate: is right that an IDE (NetBeans, Eclipse, IntelliJ) will get you compiling and running fast; is right that knowing how to install/configure the JDK and PATH pays off later. A practical approach: use an IDE to learn Java syntax and immediate feedback, then follow the quick checks above once you’re ready to compile from the shell. NetBeans and the official tutorials are good starting points. (docs.oracle.com)

Recommended Answers

All 8 Replies

Member Avatar for Member #46692

My advice would be to download something like netbeans, so you can can type your program in the editor and then press a nice shiny button to get it to compile and run. It's fool proof.

Using an IDE will never teach him to install and configure his environment properly.
It's a workaround rather than a solution.

Download the JDK from http://java.sun.com and READ and follow the installation and configuration instructions.
They're quite good, the only reasonably intelligent people who have trouble are those who don't follow them.

Member Avatar for Member #46692

>Download the JDK from http://java.sun.com and READ and follow the installation and configuration instructions.

Ah but you see that is based on the assumption reasonably intelligent people take up programming. We all know that's a lie.

Go with netbeans, and worry about the command line stuff later. Nice shiny buttons...one click away...you can't go wrong.

So you're assuming the OP isn't reasonably intelligent yet can make a decent contribution to the industry if only he uses netbeans...

In fact if your first assumption is correct and he follows your advice soon he will be back asking how to run a Java program on another computer, which is the usual next question from such people (unless it's a post of a homework assignment by simply pasting the entire assignment text into a message with a topic description like "urgent doubt needed asap plz").

Member Avatar for Member #46692

>So you're assuming the OP isn't reasonably intelligent

Yes that's exactly my point. But not only the OP. Also just about every other java newbie. They want a quick fix solution, so I'm telling them what it is...

When you're new to something you just want it to work, with little fuss as possible. You can worry about the command line stuff later. Not a problem.

Again this is a matter of opinion. You may disagree, and you are entitled to do so. But like I said you can always learn the command line stuff later and how to set up the environment variables for your OS.

If they don't want to learn, I don't want them to succeed because if they succeed without learning they become a burden on whomever they end up working with in the future (which may just be me...).

Member Avatar for Member #46692

... they become a burden on whomever they end up working with in the future (which may just be me...).

It sounds as if you need to change the way you recruite ppl at your work. But I hear they hire all sort of dummies these days, so it wouldn't surprise me?

:eek:

btw that interview with B.S is somewhat surreal... I still can't believe it, ha!

I've little influence over the hiring process...

And if outsourcing to another company that hires anyone who knows how to spell the word "kompjuter" there's even less you can do except try to limit the fallout.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.