Quote:
Originally Posted by Lee Sorry for the back to back post but just to get your attension... How do i begin to use the JDK, it is installed but there is no program in my menu or anything, do you save the files as Jar files or something? |
hmmm... well, JDK has the standards library of Java that you probably want to PATH to your operating system Environment Variable "assuming if you're in Windows platform" so that you could compile your .java easily by just typing
in the command line then it will create the .class file, so you run your program by typing
you could use notepad to start programming java then compile it in the command prompt, there are other IDEs such as Eclipse (my favorite), or whatever that you could use to compile Java, but I personally wouldn't recommend beginners to use them..
Here's what you basically need to do as for now:
1. Setup your environment variable
Quote:
* Windows 2000/XP users may set their path by right-clicking on 'My Computer' and selecting 'Properties'. Under the 'Advanced' tab, there is a button that allows you to set the 'Environment variables'. Click on this and alter the 'Path' variable so that it also contains the path to the Java executable. For example, if you have installed Java in c:\jdk and your path is currently set to C:\WINDOWS\SYSTEM32, then you would change your path to read C:\WINDOWS\SYSTEM32;c:\jdk\bin
When you open a new command prompt, it will reflect these changes and allow you to run java programs by typing "java". If you have installed the SDK, then you will also be able to run "javac" to compile stuff.
* Windows 95/98/ME users may find that their path variable is stored in a different place. Edit the c:\autoexec.bat file and add the following line at the end: SET PATH=%PATH%;c:\jdk\bin
(This also assumes that you have installed Java in c:\jdk)
* Linux, UNIX, Solaris, FreeBSD users must set their PATH variable to point to where the java binaries have been installed. Please refer to your shell documentation if you have trouble doing this. For example, if you use bash as your shell, then you would add the following line to the end of your .bashrc: export PATH=/path/to/java:$PATH
|
2. TEST your environment variable, go to command line, type javac, and see if there's instruction for you to use that command, if not, then you don't set it up incorrectly.. otherwise, you'll see something like instruction (manual) how to use that command
3. Create a program, then compile it by using
javac command