aspose file tools*
The moose likes Beginning Java and the fly likes I feel kinda dumb but... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "I feel kinda dumb but..." Watch "I feel kinda dumb but..." New topic
Author

I feel kinda dumb but...

toolshed
Greenhorn

Joined: Aug 24, 2001
Posts: 4
My Unix/windows2k system totally crashed...well i installed them both and got them both running again on Windows2k....Well i installed jdk1.3.1 and jcreator(the editor i use)....
Here is the problem for u experienced java people....i Can't run "javac or javadoc" from the command line....it says that it is unrecongized batch file....I set the path for java so it is first...PATH=C:jdk1.3.1\bin;C:......blah.....
...Even thought i cant javac, my editor still will compile files...and works flawless...that doesnt make any sense....
I just dont understand because i need my javadoc and javac...I mean there is nothig else to configure is there....
[This message has been edited by toolshed (edited August 27, 2001).]
wessel zaalberg
Greenhorn

Joined: Jul 27, 2001
Posts: 26
Yes there is, JAVA_HOME c:\jdk1.3 and classpath.
toolshed
Greenhorn

Joined: Aug 24, 2001
Posts: 4
What do u mean JAVA_HOME....can u explain....
Thanks
------------------
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

toolshed,

Please change your name to be compliant with JavaRanch's naming policy.
Your ID should be 2 separate names with more than 1 letter each. We really want this to be a professional forum and would prefer that you use your REAL name.
Thanks,
Nathan

-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
wessel zaalberg
Greenhorn

Joined: Jul 27, 2001
Posts: 26
sorry, my mistake, JAVA_HOME is the environment variable that your compiler needs, but since it doesnot even start...
I suppose you can see in your W2K settings system/ advanced and environment your path?
If it is not defined there the command line won't have it.
You can also check on the commandline : path or set
Shane Bradley
Greenhorn

Joined: Aug 27, 2001
Posts: 9
Well, i did as u said i could not get it to work....man this is crazy...I dont have a clue now....it is like it doesnt even recongize the javac or any of the tools in the bin directory....
[This message has been edited by Shane Bradley (edited August 27, 2001).]
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
Your right, this does not make any sense. Usually when something like this happens to me, it is something VERY SIMPLE. I would try invoking javac.exe from the command line, typing in the full path (i.e. c:\jdk1.3.1\bin\javac.exe). If that doesnt work, double-check and triple check your spelling. If that is not the problem, go to the c:\jdk1.3.1\bin directory at the command prompt, and run javac.exe from there.
Good luck.
Shane Bradley
Greenhorn

Joined: Aug 27, 2001
Posts: 9
I got it to run from the command prompt by doing this:
c:\jdk1.3.1\bin\javac.exe
Now what...
do u have any idea(because i dont) how i am suppose to use javac...
Where is my editor envoking this javac to complie the file, like i said before it compiles fine...I hate computers when they acted like this...but i guess they are only as good as what they are told....
[This message has been edited by Shane Bradley (edited August 27, 2001).]
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
So when you type PATH at the command line, what do you see? Are you sure that c:\jdk1.3.1\bin is in it? Check it very very carefully. As far as your Java editor goes, did you have to tell it the location of javac.exe, or did it know on its own?
Shane Bradley
Greenhorn

Joined: Aug 27, 2001
Posts: 9
First off....i just want to know why this doesnt work....i think i am going to use Emacs tell i get this ....
THis is what i get when i use path at command line...
Path=C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\jdk1.3.1\bin
In user setting for mycpu\props\advance\enviromental variables\user variables :
Name: JAVA_HOME
Value: c:\jdk1.3.1
When I use javac.exe.....I get the options menu(--help)
I dont know man what is up with this...I got to start writing javadoc's this weekend for my program i am writing...i got to get this fixed some how....
I thought this was a self install...and then change two paths and that was it....i have had stuff in Suse easier than this...
BTW thanks for the help so far....we might figure it out...

[This message has been edited by Shane Bradley (edited August 27, 2001).]
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
When you say you get the help when you get the options menu(--help) do you mean you get this:
C:\jdk1.3.1\bin>javac
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-O Optimize; may hinder debugging or enlarge class fil
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are u
ed
-classpath <path> Specify where to find user class files
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-d <directory> Specify where to place generated class files
-encoding <encoding> Specify character encoding used by source files
-target <release> Generate class files for specific VM version
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
Oh, and by the way Shane, if you were able to make c:\jdk1.3.1\bin\javac.exe work, then c:\jdk1.3.1\bin\javadoc.exe should also work. Just javadoc all your code from the command line if need be. I usually write a batch file for each of my projects to do my javadocs.
Let me recap the current state of affairs here so we are on the same page:
1)You can compile from your JCreator
2)You can compile from the command line using c:\jdk1.3.1\bin\javac.exe
3)You can't compile from the command line just using javac.
If these are the correct facts, you are OK. You should be able to do everything you need to do.
Shane Bradley
Greenhorn

Joined: Aug 27, 2001
Posts: 9
Yes those are the facts, but when i use something i want it to work correct if at all possible....
i wonder why none of ny tools are being refrenced....
javac works i just need a pointer of some sort....
What u think...
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
OK - Try this: Create a batch file called test.bat that does nothing. Just put a line in it that says pause. Save it in C:\jdk1.3.1 and set c:\jdk1.3.1 in your PATH system variable. Now try to execute test.bat from the c:\ prompt. If this works, move test.bat to the c:\jdk1.3.1\bin directory and make sure c:\jdk1.3.1\bin is in your path. Now try running it again from the c:\ prompt.
I am curious to hear how this works for you.
Shane Bradley
Greenhorn

Joined: Aug 27, 2001
Posts: 9
That worked....I created a bat file that paused, then created a the directory listing of the jdk1.3.1 directory...
I threw the test.bat into the jdk1.3.1 directory and went to the command and typed test.bat...and that also worked....
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
Now stick that .bat file in your bin directory, tehn go to c:\ and try to run it from there.
Shane Bradley
Greenhorn

Joined: Aug 27, 2001
Posts: 9
We are getting somewhere....it did not work in the jdk1.3.1\bin directory, but worked outside the bin...in just the jdk1.3.1 directory....
So inside bin == no work
...outside bin === work
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
OK. I feel like we are getting somewhere. Something has got to be wrong with your path. Do you have c:\jdk1.3.1 in your path? You must if you were able to run the .bat file from outside that directory. Can you go to Settings-->Control Panel-->System and copy and paste your PATH variable here?
Shane Bradley
Greenhorn

Joined: Aug 27, 2001
Posts: 9
If u ever come to Cullowhee, NC(in the Mountains of NC)...I will buy u drink....

U did it man...congrats to you...Like u said something with the path....After i ran that bat file I started messing with the path...I just changed %path%;C:\jdk1.3.1\bin to %path%;c:\jdk1.3.1;c:\jdk1.3.1\bin....
And that worked...I cant thank u enough....It was starting to tick me off...
Btw one more question...what are the flags you need to run javadoc.
javadoc -flags [filename or path to it]
[This message has been edited by Shane Bradley (edited August 28, 2001).]
Greg Harris
Ranch Hand

Joined: Apr 12, 2001
Posts: 1012
do you mean flags or tags? either way, try this link... i am sure you will find what you need there.
good luck!

what?
Shane Bradley
Greenhorn

Joined: Aug 27, 2001
Posts: 9
example
javadoc -asdf [filename]
What "-asdf" do you need to open the file...search for /**...then display in html windows
[This message has been edited by Shane Bradley (edited August 28, 2001).]
BJ Grau
Ranch Hand

Joined: Jul 10, 2001
Posts: 234
I would go to the link specified above to really take adavantage of javadoc. To answer your question quick and dirty all you have to do is something like:
javadoc.exe -d c:\api c:\src *.*
where your source files are in c:\src and you want your javadocs to be written to c:\api. There are lots of options for doing this better. Go read the link above to find a solution that fits your needs more closely.
Oh and don't thank me too much for figuring out the javac thing -you did the work yourself. Just remember if soemthing isn't working just make the simplest case work and then escalate from there. This applies very much to coding also.
I suspect something is still wrong with your system though, if you already had c:\jdk1.3.1\bin somewhere in your path it should have worked. Im not sure why adding c:\jdk1.3.1;c:\jdk1.3.1\bin to the path would suddenly make the bin directory visible through the path variable. Something strange is still going on.
Did you happen to have JCreator running when you were unsuccessfully trying to invoke javac before?
I would try messing with it some more - try just having c:\jdk1.3.1\bin in your path, and restart your machine, and dont start JCreator, and then try invoking javac. Im thinking that JCreator may have its own compiler and it is doing something to your path variable when you start it. (Just a far-reaching guess)
 
wood burning stoves
 
subject: I feel kinda dumb but...
 
Similar Threads
eclipse and javadoc
ANT help required
java installation problems
javac not making a .class file
Trouble installing JDK 7