Java Problems
Okay, I have installed the JDK. Im trying to use the 'javac' command in the command prompt. It gives me an unknown command javac message. I know its installed cause its in the JDK bin file. How do I set it so i can use it thro the command prompt by just typing 'javac'?
Daniel
[305 byte] By [
Drezard] at [2007-11-20 10:46:34]

# 1 Re: Java Problems
You need to tell the operating system where to look for the javac executable. If you're using Windows, this means setting the system 'path' environment variable to include the java 'bin' directory.
See the Java Tutorial, Path & Classpath (http://java.sun.com/docs/books/tutorial/essential/environment/paths.html).
Computers are good at following instructions, but not at reading your mind...
D. Knuth
dlorde at 2007-11-10 2:14:23 >

# 2 Re: Java Problems
Although it's good to know how things like javac and paths work, you'd be better off using an IDE (Integrated Development Environment - fancy name for a program that makes your programming easier) to do your Java programming. One that I like is NetBeans, you can get it here (http://www.netbeans.org/). It's got a lot of nice features to use. You can also try Eclipse if you're up for the challenge, although I always found it a little sluggish in comparison.
# 3 Re: Java Problems
Although it's good to know how things like javac and paths work, you'd be better off using an IDE (Integrated Development Environment - fancy name for a program that makes your programming easier) to do your Java programming. One that I like is NetBeans, you can get it here (http://www.netbeans.org/). It's got a lot of nice features to use. You can also try Eclipse if you're up for the challenge, although I always found it a little sluggish in comparison.
I disagree in this case. The OP obviously is just starting out with Java. I say use an IDE once you know Java, and use it for the conveniences it gives you, not because it lets you do something that you otherwise don't know how to do.
# 4 Re: Java Problems
To each their own. I learned Java on an IDE (JBuilder, if anybody remembers that one...) and I like them because it takes you away from having to worry about things like compiling and running the right class file. Java is an annoying enough language as it is, its even worse to use the command line (like when you use javac you include the .java, but when you run the .class file you don't put the .class). It's easier just to click "Run" in the IDE.
# 5 Re: Java Problems
... Java is an annoying enough language as it is, its even worse to use the command line (like when you use javac you include the .java, but when you run the .class file you don't put the .class).I think you make Martin's case for him - if you'd started out learning how to use Java from the command line, the Javac and Java commands would be second nature - two commands really isn't much to learn, and you won't always have an IDE available - sometimes it's necessary to compile and run outside the IDE.
It's easier just to click "Run" in the IDE.True, once you've set it up. If you don't have the IDE you're familiar with for whatever reason, it's simple just to use the command prompt - if you know the basic Java commands.
The greatest obstacle to discovery is not ignorance, but the illusion of knowledge...
D. Boorstin
dlorde at 2007-11-10 2:18:29 >

# 6 Re: Java Problems
True, once you've set it up. If you don't have the IDE you're familiar with for whatever reason, it's simple just to use the command prompt - if you know the basic Java commands.
That's definitely true, at least if you're comfortable with command line - and I'll assume the vast majority of programmers are. I suppose it depends on the IDE, whether it's easy to install and set up, or how it structures it's projects, etc..