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

Ganon11
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
JosAH
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;
  2.  
  3. public class Test { ... }
  4.  
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,

Jos
Sep 7 '08 #2

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

Similar topics

6
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...
2
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...
4
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...
4
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...
3
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...
7
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-? _________________________________ ...
4
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...
9
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. ...
2
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...
0
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...
0
linyimin
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...
0
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...
2
isladogs
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...
14
DJRhino1175
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...
0
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...
0
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=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
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.