Win a copy of React Cookbook: Recipes for Mastering the React Framework this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

compiling problems

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having a problem/s getting started. When I type in (under MS-DOS at the prompt: C:\WINDOWS>) "javac HelloWorld.java" OR "javac TicTacToe.java", I get an error message stating "error: Cannot read: HelloWorld.java" or "error: Cannot read: TicTacToe.java"
I've read the forum where others have had similar problem, but . . .
I set at the end of my PATH: ;C:\JDK1.3\BIN;C:\JDK1.3\JRE\BIN
I set my CLASSPATH: set CLASSPATH=C:\JDK1.3\LIB;.;C:\JAVA
(after making a directory called "java" and storing the HelloWorld.java file in it).
I have VisualCafe installed also. Could that be causing a problem? Please help.
 
Trailboss
Posts: 23366
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does your case match up right? In other words, Java is far more case sensitive than other languages. Even C. I know that I make sure that my classpath stuff all has the right case. And anything I type on the command line has to have the right case too.
 
Alan Dooley
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, Paul,
I went back and made sure ALL cases were matched. No go -- now it tells me "Bad command or file name" when I try to compile HelloWorld.java or TicTacToe.java.
This is the third evening I worked on this. I'm ready to try using VisualCafe. Anymore suggestions? I've went thru what was said to do in the Cattledrive and the Readme.html file (installation instructions). Thanks.
 
Ranch Hand
Posts: 3143
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have the JDK jar files in you classpath. I don't know about JDK3 but JDK2 you need rt.jar and tools.jar in your classpath!
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm, you are sitting in the c:>windows directory and trying to compile a java file that is sitting in the c:>java directory??? Am I reading your post correctly?? It seems that your path is fine (type in javac at the command prompt and you should see some 'help' text) if that is what you see, move to your java directory and try compiling form there.
Hope that helps :-)
 
paul wheaton
Trailboss
Posts: 23366
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you see "bad command or file name" - that means that your path is not set to point at the java compiler.
My path includes c:\jdk1.2.2\bin which is where my java and javac stuff is.
Then, my classpath points to c:\java which is where I put my .java files that I'm working on. While I am currently in that directory, I'll try javac MyProgram.java
reply
    Bookmark Topic Watch Topic
  • New Topic