Hello everyone, well its my first time ever really using java but I did do some programming in python.

Basically my first assignment is this and seems pretty easy: https://mavdisk.mnsu.edu/lct/IT214/Assignment%201.pdf

I have never done anything with class paths but it seems simple enough.

First things first, is this the correct path to get to clas path: Rightclick on mycomputer>properties>advancetab>enviromentvariables.

Currently right now this is what my classpath is showing(sidenote: I instaled java into the default installation path):

C:\Program Files\Java\jdk1.6.0_04\bin

Before I had it look like this:

C:\Program Files\Java\jre1.6.0_04\lib\ext\QTJava.zip;C:\Program Files\Java\jdk1.6.0_04\bin

Ok now moving on, if you looked at my assignment there is an editor(SciTE) that my professor recommends along with some java file/programs to download and compile and run.

When I go to compile the first file TextIO.java I get this:

>javac TextIO.java
>The system cannot find the file specified.

This leads me to believe I'm still having an issue with my classpath.

Thanks again for your guys help.

Well, there is the "path" and there is the "classpath". Normally I adjust the path first, then write a little "Hello World" program in some directory like the Desktop and save the file as "HelloWorld.java".

// HelloWorld.java
public class HelloWorld
{
    public static void main (String[] args) 
    {
        System.out.println("Hello World");
    }
}

Then I go to a command line in the directory where I saved this and do the following at the command line:

javac HelloWorld.java

You should get no message whatsoever. If you do, there is something wrong with your path or you made a typo. Then type:

java HelloWorld

from the command line. That should cause your program to write "Hello World" to the console. Again, no other messages.

Neither of these commands requires the classpath but they do require the path to be adjusted properly. If you installed java without changing the path (not the classpath), that is probably your problem. I'm not saying you won't eventually need to change the classpath, but you won't for the example above.

Oh I think I see it now too thanks, what I was doing wrong I was assuming in the assignment when he was saying path he was referring to class path.

I think I have it now thank you. I'll update for anyone who reads this if I solved this.

Ok I solved it I was thinking of classpath and path as the samething.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.