Java Help
airbornflght
Houston, TX Icrontian
Ok, I am taking AP comp sci, and she gave us some homework to do over the summer. Now, I am trying to code these two redicuosly easy programs, but my computer will not compile them.
I have sent an email to my instructor, but it may be a few days before she checks her email. anyway, I have attached the same pdf here that I sent her. Hopefully we can figure this out. I thought these two would be 2 minutes of typing, compile, execute, done.:sad2:
I have sent an email to my instructor, but it may be a few days before she checks her email. anyway, I have attached the same pdf here that I sent her. Hopefully we can figure this out. I thought these two would be 2 minutes of typing, compile, execute, done.:sad2:
0
Comments
I installed everything like she said to, I installed the sdk, then the ide. that is all I did, it installed in the default directory.
from java.sun.com:
also make sure the current directory is on the path, so after you put in an entry for your java installation put in a semi-colon followed by a period.
you'll also want to set a JAVA_HOME variable while you are there. set it to the install directory of the jdk, for instance if i installed java in c:\j2sdk1.5
i'd set JAVA_HOME=c:\j2sdk1.5
set these env variables and give it another shot. if they still wont compile, you might have used the 'import' declaration improperly.
usually you have to put the full package and class name, like if i had a class called com.lightnin.io.FileReader, i'd have to say 'import com.lightnin.io.FileReader;' in order to use it. i'd also have to have that class either on my classpath or residing in a folder called ./com/lightnin/io/
your stuff wont compile because the compiler isn't 'seeing' the files you want to import. so either you have a classpath problem, or your files arent located in the right place.
you might want to read over this brief tutorial:
http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html