•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 391,591 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 2,700 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: 99040 | Replies: 58
![]() |
•
•
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation:
Rep Power: 9
Solved Threads: 18
•
•
•
•
Originally Posted by C++
server_crash, there's an option called "Output Path" you can change. Is this what I'm looking for?
That's exactly what your looking for. Now, go find the directory where the source file is, and set the output to that directory.
server_crash, the source files r the .java files - correct?
thanx again for all your help
thanx again for all your help
•
•
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation:
Rep Power: 9
Solved Threads: 18
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.
•
•
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation:
Rep Power: 9
Solved Threads: 18
•
•
Join Date: May 2005
Location: Digos City,Philippines
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Hi,
Make it sure that your in correct path,make sure also that you've compiled
your java source file(s) -(.java).
Hint:at the dos prompt- ex. assuming that your in the directory D:\javafiles just.Type d:\javafiles\d:\j2sdk1.5.0\bin\javac fileName.java.
-email link removed. Please follow up discussions in the forum thread only - Catweazle
Thatz all folks.
Make it sure that your in correct path,make sure also that you've compiled
your java source file(s) -(.java).
Hint:at the dos prompt- ex. assuming that your in the directory D:\javafiles just.Type d:\javafiles\d:\j2sdk1.5.0\bin\javac fileName.java.
-email link removed. Please follow up discussions in the forum thread only - Catweazle
Thatz all folks.
Last edited by Catweazle : May 29th, 2005 at 3:29 am.
actually, when i change the path on jbuilder, it saves the files to the same place. can i copy and paste them to the same folder? another thing's weird: when i type javac, it says it's an unrecognizable command, but when i type java, it works
•
•
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation:
Rep Power: 9
Solved Threads: 18
Ok, you can try to copy and paste the class file into the right directory and try running it. That would probably work, but it wont fix the problem.
You said something about the javac command? Are you using the command line? If so, that error is the result of your environment variables not being set correctly.
You said something about the javac command? Are you using the command line? If so, that error is the result of your environment variables not being set correctly.
server_crash, first, I want to thank you for helping me so much with this problem.
I'm using command prompt. is there a way to change those variables? Also, i created the class files with jbuilder, not console.
If I copy and paste the files, is there a certain folder name I need. Also, my program has multiple classes. I compile the one with the main method... correct? Last, Should I put all of the sound and picture files in that folder also?
Thank you SO much!
•
•
•
•
You said something about the javac command? Are you using the command line? If so, that error is the result of your environment variables not being set correctly.
•
•
•
•
Ok, you can try to copy and paste the class file into the right directory and try running it. That would probably work, but it wont fix the problem.
Thank you SO much!
•
•
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation:
Rep Power: 9
Solved Threads: 18
•
•
•
•
Originally Posted by C++
server_crash, first, I want to thank you for helping me so much with this problem.
Your very welcome. I love helping people such as you who are so appreciative and hard working. Keep up the good work!
•
•
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation:
Rep Power: 9
Solved Threads: 18
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.
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