1. Check out our app, Forums for Android! Download and leave feedback here!

JDK Problem

Discussion in 'Application Development' started by VerizonLover, Sep 11, 2010.

  1. VerizonLover

    VerizonLover Member
    Thread Starter
    16

    Aug 27, 2010
    12
    1
    16
    Opelika, AL
    I'm just starting with Java programming (with "Teach Yourself Java 6 in 21 Days", but I'm stumped at the beginning. It won't let me run any java files!

    I know my classpath is set incorrectly, but what do I need to set it to?

    I have the JDK installing in "C:\Program Files (x86)\Java\jdk1.6.0_21" and the JRE installed in "C:\Program Files (x86)\Java\jre6". But every path I try it gives me an error: "Could not find the main class". Using the command 'java <file name>" What do I do? I have tried setting to the lib directories of both, but no dice. Please help. I'm running the 'java' command from the jdk's bin directory. I also have the JDK's 'bin' directory in my path.

    I have no prior knowledge of programming, BTW.

    After finishing that book, I'm going to start "Beginning Android 2"
     

    Advertisement

  2. johnlgalt

    johnlgalt Antidisestablishmentarian
    453

    Oct 28, 2009
    9,416
    1,924
    453
    Male
    Graduate Research Assitant | That part time IT guy
    3rd Rock
    The classpath is where you store your .jar or .class files - aka the JAVA source code files.

    Since you're going to be writing programs, you do not want to store your .class files in the same directory as the JDK bin files / lib files, etc.

    make a directory that is easily accessible (C:\classfiles should work) and store all of your source code in there.

    See Setting the class path for more info.
     
  3. VerizonLover

    VerizonLover Member
    Thread Starter
    16

    Aug 27, 2010
    12
    1
    16
    Opelika, AL

Share This Page

Loading...