I've been teaching myself Java for about a month now, using books at online sources. This has been done entirely within NetBeans and I'd like to start using the terminal. For the life of me, I cannot figure out how to set the classpath variable. In fact, I am completely confused by this concept. I am using a MacBook with the latest version of OS X, along with Java build 1.5.
It seems like I am supposed to create a "classes" folder and then point my terminal to that folder, but I get errors when I try to do this and I'm not quite sure where the best place to put this folder is, if this is what I am even supposed to do. I am also not sure if the Mac OS comes with all the Javadocs, or if these can only be accessed by NetBeans.
Originally posted by Patrique Williams: ... It seems like I am supposed to create a "classes" folder and then point my terminal to that folder, but I get errors when I try to do this...
Welcome to JavaRanch!
Can you provide more details about how exactly you are doing this? And what errors you are getting?
It's likely that you will not need to set a system classpath.
(Meanwhile, for some basics on command line Java, see this thread.) [ June 22, 2008: Message edited by: marc weber ]
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
posted 11 years ago
Thanks for the link. Right after I posted this I figured out what I needed to do, thanks to a Google search and help from a friend.
I created a folder named "classes" in which I created a "HelloWorld" folder, in which I enclosed the "HelloWorld.java" file. Then I typed: cd classes/helloworld, which pointed me where I wanted to go. Afterward I used the Javac command to compile the .class file, followed by the java command to run the file and everything worked beautifully.