Results 1 to 3 of 3

Thread: Running Java Compiler

Threaded View

  1. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    It is not necessary that you put your .java files in the bin directory. You can place your files in any directory that you choose as long as you specify the directory where the file is located that you wish to compile. ie... C:\jdk1.3\bin javac C:\Java\MyFile.java

    Now to compile you have to be in the bin directory unless you change that so you can compile your .java files from outside of that directory.

    From the DOS command line type set. A whole bunch of stuff should be listed. The second to last entry should read path = Now at the command line type in path = C:\jdk1.3\bin. Now when you go back by typing set you should see that the path will now say C:\jdk1.3\bin. This enables you to compile with out having to be in the bin directory.

    As for being able to run files i dont think that the class path can be set from dos itself. The usual method is to set the CLASSPATH environment variable to point to the directory where the .class files reside that you want to run. But remember that once you change the autoexec.bat file a system reboot is needed for the changes to take effect. You can always run using C:\jdk1.3\bin -classpath C:\MyPath; MyProgram

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width