473,394 Members | 1,759 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,394 software developers and data experts.

Classpath for java program files

17
Hi,

i set the classpath what ever required and my java program is running fine .
i have installed jdk in C:\ , am saving my files in D:\
while compling in command prompt i have to go to that directory and then compile and run
what i want is to run the program from any Directory path(ie either from C: or D:) in command prompt , is it possible?

if yes , how ?


Thanks
Jan 4 '08 #1
3 1637
r035198x
13,262 8TB
Hi,

i set the classpath what ever required and my java program is running fine .
i have installed jdk in C:\ , am saving my files in D:\
while compling in command prompt i have to go to that directory and then compile and run
what i want is to run the program from any Directory path(ie either from C: or D:) in command prompt , is it possible?

if yes , how ?


Thanks
What did you set your classpath to be?
What error do you get when you try to compile your files in D?
Jan 4 '08 #2
hostel
17
What did you set your classpath to be?
What error do you get when you try to compile your files in D?
C:\j2sdk\bin
i store my java files in D:\java
when i go to that directory ie D:\java i can compile and run with no problem

but when i compile from C:\ i get error that "file could not be found" (which is true)

so wat to do.
Jan 6 '08 #3
JosAH
11,448 Expert 8TB
C:\j2sdk\bin
i store my java files in D:\java
when i go to that directory ie D:\java i can compile and run with no problem

but when i compile from C:\ i get error that "file could not be found" (which is true)

so wat to do.
The Java compiler compiles Java source files so you have to tell it exactly where
those source files are. Maybe your filing system has the feature of (symbolic)
links so you don't need to type that much. For .class files there's the CLASSPATH
variiable setting available, but those files were compiled already.

There's one flag avaiable: -sourcepath, but it doesn't consider it a path to the file
you explicitly want to compile; it just works when the compiler finds a .class file
that happens to be out of date so it can recompile that file for you.

kind regards,

Jos
Jan 6 '08 #4

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

Similar topics

0
by: Murat Tasan | last post by:
okay, i have an odd problem... and maybe it's platform-specific... but i figure give it a shot and ask about it in case someone has seen this. i have an application that is made up of numerous...
1
by: Ric | last post by:
thx for the help. im having problems with java and jsp. i think im not settup up the enviornmental variables right in w2k advanced tab. im using a wrox book, but the wrox book references a servlet...
1
by: Steven Mason | last post by:
Here's my problem. I've certain jar files I've included in my classpath that I need to work with. I've included these in my path variable so when I type path at the command line I get : ...
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...
1
by: trpost | last post by:
I am using javascript to call a hidden applet and am getting a javascript error "java.lang.Exception: java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpClient" If I comment out the...
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-? _________________________________ ...
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. ...
1
Stubert
by: Stubert | last post by:
Hey guys I'm using a Window Vista laptop and I've been away from it for a while, but since I've came back I've been trying to compile programs on JCreator LE 4.5, it must be something ridiculous but...
10
by: giantfatiguana | last post by:
hey all im a beginner java user and am getting an error relating to the classpath i assume. I have a file JM550b.java which is trying to access the class QTCycle when compiling. QTCycle.java...
1
Ganon11
by: Ganon11 | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.