473,396 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 3273
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.