This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes javac Problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "javac Problems" Watch "javac Problems" New topic
Author

javac Problems

Sturgis Plutard
Greenhorn

Joined: Jul 22, 2006
Posts: 1
Well, I have a lot of experience using NetBeans, but I'm trying to compile/run a program on a computer without the NetBeans IDE, and I'm having problems:

Note: to make things easy, I saved the file in question to the Desktop. Also, I have updated the PATH variable to the loaction of the folder containing the javac compiler (C:\Program Files\Java\jdk1.5.0_07\bin).

In the command line window, when I get to the Desktop directory, and type:

I get the following error:


Any thoughts? Might there be a problem with my path? Is there a problem with the JRE/JVM?


while(true)<br />{<br />System.out.println("ARRRRGH!");<br />}
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Hi,

Welcome to JavaRanch!

A long time ago, the JVM tools used the CLASSPATH to find the core classes; perhaps Microsoft's VM always worked this way. But modern JVMs -- certainly JDK 1.5! -- don't; they have their own way of locating the core classes, which are located in (JDK)/jre/lib/rt.jar .

So all I can say is that your JDK installation seems to be broken, and this file is either missing or corrupt. Is that file on your system? If you try to list its contents with the jar.exe command, does it work? I.e.,

jar tf "C:\Program Files\Java\jdk1.5.0_07\jre\lib\rt.jar"

ought to produce a very long listing of all the classes in the Java API; does it?


[Jess in Action][AskingGoodQuestions]
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14278
    
  21

What is the contents of your PATH environment variable? Maybe you have another version of another JVM on your system and you're mixing different Java versions here.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: javac Problems