•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 392,057 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,244 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 99099 | Replies: 58
![]() |
first, i need to apoligize for not responding sooner. I've been studying and taking Finals all of last week. They're finally over!!!!!! 
second, i changed the variables and it worked!
third, the program I'm compiling has 8 .java files. which do i compile first?
server_crash, thank you so much for your help.

second, i changed the variables and it worked!
third, the program I'm compiling has 8 .java files. which do i compile first?
server_crash, thank you so much for your help.
•
•
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation:
Rep Power: 9
Solved Threads: 18
Shhewww, that's a lot of work..8 files.
It will be hard to tell what to compile first. You'll need to find the file that calls no other classes. Since I don't know the code or anything, I think the best thing for you, is to compile everyone of them until you don't get an error. You should get an error on the ones that call other classes that aren't compiled. Then once you get one of them compiled, start the process over!
It will be hard to tell what to compile first. You'll need to find the file that calls no other classes. Since I don't know the code or anything, I think the best thing for you, is to compile everyone of them until you don't get an error. You should get an error on the ones that call other classes that aren't compiled. Then once you get one of them compiled, start the process over!
•
•
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation:
Rep Power: 9
Solved Threads: 18
•
•
•
•
Originally Posted by C++
server_crash, thank you so much for your help.
No problem. Your very hard working, and I don't mind helping out such a person. By the way, how did you do on your finals?
I got an A- on my math final but i dunno about the others - I get them back on wednesday
•
•
Join Date: Jun 2005
Posts: 14
Reputation:
Rep Power: 4
Solved Threads: 0
•
•
•
•
Originally Posted by server_crash
Yes. Actuallly, when you find the folder containing the source file(.java), you should notice the .class file is not in that same folder. If it is, then we have problems! Naturally it should be in the same folder as the source, but since your getting that error, let's hope it's not. If it is in the same folder, then we got some problems with the classpath which will be harder to fix.
I had the same problem as above, and I DO have the .class folder and the .java folder in the same place - in my C: drive. Also, I have the path pointing to the bin folder where the compiler in.
It compiled fine (created the .class folder), and now it won't run.
Please help!
•
•
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation:
Rep Power: 9
Solved Threads: 18
•
•
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation:
Rep Power: 9
Solved Threads: 18
If you're starting out, I would stick with the command line for a bit. It probably is the classpath, altough you set it. The classpath can be very hard to set, and usually you won't get it the first time.
Please post your current classpath so that I can take a look at what you have.
Please post your current classpath so that I can take a look at what you have.
•
•
Join Date: Jun 2005
Posts: 14
Reputation:
Rep Power: 4
Solved Threads: 0
•
•
•
•
Originally Posted by server_crash
If you're starting out, I would stick with the command line for a bit. It probably is the classpath, altough you set it. The classpath can be very hard to set, and usually you won't get it the first time.
Please post your current classpath so that I can take a look at what you have.
I think this must be wrong... do you need my regular path too?
•
•
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation:
Rep Power: 9
Solved Threads: 18
I HOPE that's not your classpath!!!! :lol:
It should poin to the tools.jar file in your jdk directory:
Something along the lines of this:
C\Program Files\Java\jdk1.5.0\lib\tools.jar
Take a look at this, this was one of my earlier posts.
It should poin to the tools.jar file in your jdk directory:
Something along the lines of this:
C\Program Files\Java\jdk1.5.0\lib\tools.jar
Take a look at this, this was one of my earlier posts.
•
•
•
•
Originally Posted by server_crash
Ok, since your using the command prompt I can help you even more, because that's what I use. First of all, you need to create a folder on the C drive, and name it whatever you want. This is the folder you'll put all of your source files, class files, and miscelaneous files in.
Now to the environment variables:
Considering you have windows:
Goto start--->right click on my computer--->select properties
Goto the advanced tab, and you should see a button at the bottom that says environment variables...click on that.
The only thing you need to worry about is the PATH variable, and the CLASSPATH variable, nothing else.
SKIP THIS STEP AND GO ON TO THE CLASSPATH, IF IT DOESN'T WORK AFTER SETTING THE CLASSPATH, THEN COME BACK AND SET THIS.
The path variable must point to the bin folder in the sun app server, and the bin folder in the jdk directory. Now, those are two different directories, so you seperate them with a semicolon when creating it. Here is what mine looks like:
C:\Sun\AppServer\bin;C:\Program Files\Java\jdk1.5.0\bin
Classpath....This points to the tools.jar file in the jdk directory. It's pretty easy to find. Here is what mine looks like:
.;%classpath%.;C\Program Files\Java\jdk1.5.0\lib\tools.jar
Your's will look similar, although you do not need the .;%classpath%.; statement.
Next, you need to know how to access your files at the command line.
To do so, you simply type cd/folderName at the command line. The cd stands for current directory. My folder was named javawork, so to access it, I did this at the command prompt:
cd/javawork // brings me to the right directory
javac Hello.java //compiles my program
java Hello //runs my program
Let me know if you don't undestand something or need more help.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
Other Threads in the Java Forum
- Previous Thread: Assigning Array Values En Masse
- Next Thread: Q. Lotus Notes + Java?



Linear Mode