File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Getting javac to work in Win NT, setting the path and things Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Getting javac to work in Win NT, setting the path and things" Watch "Getting javac to work in Win NT, setting the path and things" New topic
Author

Getting javac to work in Win NT, setting the path and things

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Howdy Folks,
I did this long ago but I forgot.
I just installed jd1.2.2 on Win NT.
at the command prompt c:\>java works fine.
But c:\>javac does not.
I have set the System Path Variables in the Environment Settings.
I created a new variable called Classpath and set it.
But to no avail.
Could anyone help me with this.
Thank you very much
Bill
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Bill,
You don't need a classpath for compiling java code. The important environment variable is PATH. Make sure you supply the bin directory where you have installed jdk1.2.2.
Java executables in:
C:\jdk1.2.2
Path should include:
c:\jdk1.2.2\bin
Manfred.
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi,
I tried that, but it still does not work.
I pointed to the correct jdk bin.
;(
Bill
Peter Tran
Bartender

Joined: Jan 02, 2001
Posts: 783
If you can execute java, then you should be able to execute javac, because they are both in the jdk1.2.2\bin directory. If you type javac, do you see the following?

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 file
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-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

If yes, then your path is fine.
-Peter
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hey Peter,
Its not quite so.
Thanks
Bill

Originally posted by Peter Tran:
If you can execute java, then you should be able to execute javac, because they are both in the jdk1.2.2\bin directory. If you type javac, do you see the following?
If yes, then your path is fine.
-Peter

Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Hi Buff,
Can you show us your directory structure for the SDK, and show us waht you have now for your path and classpath.
Also if you still have an old version of java loaded that could cause problems.
Try reading this: http://www.javaranch.com/ubb/Forum33/HTML/001304.html
***********************************************************

PS, we really want to get to know you as YOU. See the JavaRanch post you made.

"JavaRanch, where the deer and the Certified play" - David O'Meara
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

Buffalo Bill,
Your name does not comply with the Javaranch naming guidelines which can be found at http://www.javaranch.com/name.jsp
In particular

Do not use cute names like "Justin Case" or "Adam Baum". Do not use the names of celebrities.

please register again with a valid name.


SCJP
Visit my download page
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hi Cindy,
Thank you for the infomation
I will register.
Thanks
Bill

Originally posted by Randall Twede:
Buffalo Bill,
Your name does not comply with the Javaranch naming guidelines which can be found at http://www.javaranch.com/name.jsp
In particular

Do not use cute names like "Justin Case" or "Adam Baum". Do not use the names of celebrities.

please register again with a valid name.

Stephen, Lawson
Greenhorn

Joined: Feb 19, 2001
Posts: 3
Buffalo Bill = Stephen Lawson
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
HI Stephen,
So nice to meet the REAL you!!!
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Stephen,
Are you still having problems with your path? Since you specified that you are working on WinNT, I will show you the way you need to set up your environment variables on that platform.

  1. Go to Start > Settings > Control Panel.

  2. Click on System icon.

  3. Go to the Environment tab.

  4. [list]In the Variable text box enter this text:

    [/list][list]In the Value text box enter this text:

    (If the path to your java.exe and javac.exe files are different, you need to put that directory instead. To check for the right directory, go to Start > Find > Files or Folders... and look for javac.exe)
    [/list]
  5. Press the Set button.

  6. [list]Now enter this text in the Variable text box:

    [/list][list]Now enter the directory your java programs will be in in the Value text box, something like:

    [/list]
  7. Press the Set button again.

  8. Press the Apply button and close the System Properties and Control Panel windows.


  9. Your path and classpath should now be set, and you should be able to compile and run Java programs!
    (Another problem that may crop up concerns older JDK versions. If you had an older JDK installed, you will need to delete your current JDK completely before you install a newer version.)
    HTH,
    -Nate


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

Joined: Feb 20, 2001
Posts: 3
Since all .java files are aleways saved in "bin" folder in "jdk1.3".you first goto that particular path and then proceed.
C:\>cd jdk1.3
c:\jdk1.3>cd bin
c:\jdk1.2\bin>
now proceed.
NOTE:All .java files are compiled to .class files only in"bin" folder , where all inbuilt classes are saved in kit.
Stephen, Lawson
Greenhorn

Joined: Feb 19, 2001
Posts: 3
Thanks Guys,
Thanks Cindy, Thanks Nathan and Thank you Vivekanada.
Stephen Leacock Lawson
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting javac to work in Win NT, setting the path and things