472,800 Members | 1,604 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,800 software developers and data experts.

Setting Classpath

3,652 Expert 2GB
Hey all,

I'm setting up my computer to run Java for a class I'm taking, and I've gotten into a bit of a snag.

I've set the CLASSPATH system variable to include the base folder of my homeworks etc:

"CLASSPATH=C:\Users\Ganon11\Documents\Programm ing in Java;..."

I can now use the java and javac commands when my files are located in this folder. However, for organization, I wanted to put my files in separate folders based on the assignment; the first homework files go into folder HW 1, etc. etc. I expected that the javac command would still work in a subfolder of Programming in Java, but it's not working properly.

I know I can set the CLASSPATH to include the HW 1 folder, but considering there will be close to 15 homeworks, I'm not too enamored with the solution. Is there a way to apply the CLASSPATH to all subfolders of Programming in Java?

I tried putting "CLASSPATH=C:\Users\Ganon11\Documents\Programm ing in Java\*;..." but it didn't work.

Thanks in advance.
Sep 6 '08 #1
1 3235
11,448 Expert 8TB
If you use those subfolders hw1, hw2, ... etc. as packages it'll work again, e.g.

Expand|Select|Wrap|Line Numbers
  1. package hw1;
  3. public class Test { ... }
store this file in the hw1 folder and compile it like this: "javac hw1.Test.java" and
run it like this: "java hw.Test". Make sure that the compiled .class files are at
their correct locations as well.

kind regards,

Sep 7 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Johan Louwers | last post by:
I have a qustion. I have to set a JAVA_HOME variable on a Solaris9 system... what kind of a variable? A system-defined.../....a user defined.../.....???? and how do I set this so java can...
by: David Cook | last post by:
Windows (XP and NT) allows one to specify environmental variable (such as PATH and CLASSPATH) at both the SYSTEM-wide level as well as at the per-USER level. And the behavior has always been...
by: Abdelhalim MIMOUNI | last post by:
hi, i'm new to java, and using sun last JDK, and i'm trying to understand how work this feature when we want to compile at command line ? i'm trying to set the classpath to the directory of the...
by: Ashwin Kutty | last post by:
Hi all, I sent this message to the jdbc list and received no response there and so am posting to this list hoping I could get some help here. Thanks in advance. ---------- Forwarded message...
by: jeremiah johnson | last post by:
Okay this is going to sound really dumb. Skeet, you can poke fun of me in your own special way if you see fit. Is there a way to reproduce the CLASSPATH functionality of Java within C#? Would...
by: dlarsson | last post by:
Okay folks, I thought I was doing something very, very simple, but I cannot seem to get this to work at all. Can anyone identify what I am doing wrong here-? _________________________________ ...
by: nawrin22 | last post by:
hi.. I am a niwebie in 'AXIS' . but i had correctly installed it without any problem with the help of 'apache.axis.install.pdf' and also tested the examples under 'samples\userguide' directoy...
by: KevinRobinson | last post by:
Hi, Can anyone please tell me how to add or change a Java classpath in SUSE Linux 9.3. I have set up a Tomcat server but my Java Classes will not run although they do on a windows box. ...
by: harig | last post by:
hi all is it possible to set a classpath from java.... for eg. i need to set a classpath for a folder like this APP_PATH = c:\tomcat\webapps\myPath how do i set it from...
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: lllomh | last post by:
How does React native implement an English player?
by: Mushico | last post by:
How to calculate date of retirement from date of birth

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.