|
-
Jul 24th, 2003, 02:16 PM
#1
Thread Starter
Frenzied Member
errr....?
I've installed the sdk and everything, and when i try to compile my hello world program from sun (javac HelloWorldApp.java) it says
'JAVAC' is not recognized as an internal or external command, operable program or batch file.
-
Jul 24th, 2003, 03:00 PM
#2
Dazed Member
What are you compiling from? javac HelloWorldApp.java would be the proper syntax for compiling your .java file HelloWorldApp
My command line would look like this. C:\jdk1.3\bin> javac C:\Java\HelloWorldApp.java
-
Jul 24th, 2003, 03:24 PM
#3
Fanatic Member
You got to have the bin folder in you CLASSPATH for that to work. Do you understand what I'm saying? If not, I'll post you an example. Later, Jeremy
He who listens well, speaks well.
-
Jul 24th, 2003, 03:46 PM
#4
Thread Starter
Frenzied Member
yeah not really sure...if you could post that example that would be great
-
Jul 24th, 2003, 03:52 PM
#5
Fanatic Member
It really all depends on the operating system you are using but here goes. For you to use any of the java tools from the command line from anywhere in your system, you have to have the Java SDK bin folder in your CLASSPATH. Here is what you need to do:
1) Right-click "My Computer" and select Properties
2) Click the "Advanced" tab.
3) Click "Environment Variables" button.
4) Look for a variable called "CLASSPATH" and if it's there, double-click it and add the physical path to the bin folder in your Java SDK Folder (Ex: "C:\Java2SEDK\bin;");
5) If it's not there, click new and give it a name of "CLASSPATH" and then put the path, like in step 4, in the Value.
If you need more help, let me know. Also...you can use an IDE to do most of this for you. I use NetBeans and you can compile and run your programs in the IDE without having to go to the command line. Best of all, it's free and one of the best Java IDEs available. Even Sun's IDE is based on NetBeans. Here is a link:
NetBeans
HTH, Jeremy
He who listens well, speaks well.
-
Jul 24th, 2003, 03:56 PM
#6
Dazed Member
I don't think that it is necessary to have the bin folder set in the CLASSPATH under the autoexec.bat. I think all you need is it to set the directory when your .class files are located in the CLASSPATH.
Last edited by Dilenger4; Jul 24th, 2003 at 11:11 PM.
-
Jul 24th, 2003, 04:01 PM
#7
Thread Starter
Frenzied Member
still doesn't recognize javac as a command i've got it working on netbeans, wonder why not here
-
Jul 24th, 2003, 04:05 PM
#8
Fanatic Member
CLASSPATH if very important here. Will you email me your CLASSPATH? Also...do you have your JAVA_HOME set? Later, Jeremy
P.S. - [email protected]
He who listens well, speaks well.
-
Jul 25th, 2003, 07:00 AM
#9
Neither CLASSPATH nor JAVA_HOME are of interest here, what is important is PATH.
PATH must include the bin subdirectory of your SDK installation.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 25th, 2003, 09:19 AM
#10
Fanatic Member
CornedBee is correct once again. I though that if you put the bin in you CLASSPATH that would help you if you didn't put it in your PATH no?
He who listens well, speaks well.
-
Jul 25th, 2003, 10:05 AM
#11
CLASSPATH only has a meaning for the Java Virtual Machine, it's where the class loader searches for .class files.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 25th, 2003, 12:28 PM
#12
Dazed Member
Posted by CornedBee
Neither CLASSPATH nor JAVA_HOME are of interest here, what is important is PATH.
PATH must include the bin subdirectory of your SDK installation.
Exactly. That was what i was trying to get at.
-
Jul 25th, 2003, 12:31 PM
#13
Fanatic Member
I was wrong all. Please forgive my lack of judgement before posting,
He who listens well, speaks well.
-
Jul 25th, 2003, 12:34 PM
#14
Dazed Member
A while back i could type in set path = C:\jdk1.3\bin at the DOS prompt which would enable me to run the compiler outside of the \bin directory. For some reason i can't get it to work.
-
Jul 25th, 2003, 12:39 PM
#15
Fanatic Member
Here is a good link on how to set PATH from the Command Line
PATH
HTH, Jeremy
He who listens well, speaks well.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|