• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Classpath, Packages, etc.

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
C:\Java_Programs
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Claude,

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

path javac c:\Java_Programs\Meaty.java

"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:

c:
cd \Java_Programs
javac Meaty.java

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic