Jem Posted January 17, 2003 Share Posted January 17, 2003 Once I'm done with my Java Source File I cannot compile it under Command Prompt because I don't know how to specify the path javac has to use to look up classes. Can someone tell me what is the command line I need to use to specify that path? Thanks. Link to comment Share on other sites More sharing options...
Keyan Farlander Posted January 18, 2003 Share Posted January 18, 2003 You're not being specific on what platform you are on or anything, but if you just type "javac" you should get the usage deal. I just tried it on a Solaris machine and got this: 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 us 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 Doesn't that pretty much tell you what you need to know (the classpath bit)? Link to comment Share on other sites More sharing options...
Jem Posted January 20, 2003 Author Share Posted January 20, 2003 What I need is to use the javac command to compile my Java source code into Java bytecodes. But each time I type "javac filename.java" under command prompt: Ex: C:\Work\javac filename.java (My Java source code being in the file "Work") It says: 'javac' is not recognized as an internal or external command, operable program or batch file Now I've been told that it's because I need to specify the classes location. I've tried what you said and this: http://java.sun.com/j2se/1.3/docs/tooldocs/win32/classpath.html But there's something I'm doing wrong because it still doesn't work. Link to comment Share on other sites More sharing options...
Keyan Farlander Posted January 20, 2003 Share Posted January 20, 2003 I doubt it. Try just typing "javac" and see if you get anything (you should get about what I put in my previous post). If not, it has nothing to do with classes. It probably has to do with javac itself not being where your system can find it as a program. Try compliling in the directory where javac is located, and if it works, then you just need to set up some path crap to get it to work as you want. Link to comment Share on other sites More sharing options...
Jem Posted January 20, 2003 Author Share Posted January 20, 2003 I'll try that as soon as I can and tell you how it went. Thanks. Link to comment Share on other sites More sharing options...
Jem Posted January 23, 2003 Author Share Posted January 23, 2003 Ok, it works. All I had to do is set the Path in the "My Computer" Advance Properties. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.