File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Classpath, Packages, etc. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Classpath, Packages, etc. " Watch "Classpath, Packages, etc. " New topic

Classpath, Packages, etc.

Claude Cundiff
Ranch Hand

Joined: Mar 20, 2008
Posts: 78
Hello everyone.

I'm going to try to keep this as brief as possible...

I'm having some issues understanding how to use multiple packages and set the classpath.

So far, I've only dealt with single source files. I've written two .bat files, one to compile and the other to run the program:

All the class files are in the following directory:
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15099

Hello Claude,

The following line in your compile .bat file isn't correct:

path javac c:\Java_Programs\

"PATH" is an environment variable in Windows. You set it to tell Windows where to look for executable programs. The Java compiler (javac.exe) is a program, and you need to tell Windows that it's in the bin directory where you installed the JDK. Step 4 of the JDK installation instructions explains how you should set the PATH.

When this is set correctly, you can compile your Java source code with the following commands:

cd \Java_Programs

I am moving this topic to the Java in General (Beginner) forum, because it's not directly related to SCJP. Please click on the link at the top of this page to go there.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: Classpath, Packages, etc.
It's not a secret anymore!