Results 1 to 4 of 4
Hi! I have been looking for a programming language to start with, but then I realized that the local comm. college only offers Java, so I figured whether I want ...
- 01-07-2008 #1Linux Newbie
- Join Date
- Jul 2007
- Location
- Here. There. Anywhere.
- Posts
- 150
javac
Hi! I have been looking for a programming language to start with, but then I realized that the local comm. college only offers Java, so I figured whether I want to or not, that's what I should start with...
So, I have a hand-me-down book that I am learning from, and I am having enough trouble as it is getting lost within editors and the JDK stuff, but as far as I can tell "javac" is not even a legal term anymore. Is this true? And if this is the case, exactly how out of date is my book? I mean, would I be better off learning strictly online? (Not to be nostalgic, but it does seem a little awkward to run a computer and read read documentation from it at the same time....)Last edited by ryokimball; 01-07-2008 at 12:56 PM. Reason: bad choice of words
- 01-07-2008 #2
javac is still the compile command for Java. That hasn't changed. However, in the last few years, the way we use it has. The improvements made in IDE's have pretty much made the compilation process transparent. If you use Eclipse or Netbeans, statements that would fail at compile time are underlined in the same way a misspelled word would be underlined in Microsoft Word. However, I think it would be a good learning experience for you to refrain from using an IDE while you're first learning the language. Edit your code using whatever text editor you prefer and then learn to compile and run it by hand. Then, once you understand the process, you can move to an IDE and you will fully realize just how good you have it and how easy things have been made for you.
- 01-07-2008 #3Linux Newbie
- Join Date
- Jul 2007
- Location
- Here. There. Anywhere.
- Posts
- 150
Oh, okay... well, perhaps I have some other sort of problem. I'm in Vista now, but even in Fedora 8 or my test machine (which doesn't really count, because it is rabid anyways) it swears that no command with the name "javac" exists. Is there some way I might have accidentally installed JDK so that "java" works but "javac" does not?!
P.S. Out of curiosity I tried using "javac" on a different computer (my baby sister's/"the living room" computer running Fedora Core 6) and it does accept "javac" as a legal command... but my computer is WAY more powerful, and my test machine (albeit self-destructive) is in my bedroom (thus more accessible)....
Besides, I don't get why it is acting the way it is and I don't like things not working. Any ideas?
- 01-07-2008 #4
There could be a couple of reasons why your system can't find the javac command. One is that, it is installed, but is not in your PATH. Your PATH variable is a list of directories that the system will search to find any commands you enter. It could be that you have the jdk installed properly and that it just isn't in your PATH. You can find out what is in your path by running:
I think Fedora installs java to /opt by default and /opt usually isn't included in a normal user's PATH. So, check if there's an /opt/java directory and see if you can find javac there. If you can, you can easily add that directory to your path. You can also locate the absolute path of a command by using the whereis command:Code:echo $PATH
The other possibility is that you only have the jre installed. The jre allows you to run java programs but doesn't give you the ability to compile them. If I had to guess, I would say this is what is happening on your machine now. If you want to code in Java, you need the jdk. Use Google to find a tutorial for installing the jdk on Fedora. There are plenty of them out there.Code:whereis java


Reply With Quote