File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "javac Problems" Watch "javac Problems" New topic

javac Problems

Sturgis Plutard

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

Joined: Jul 08, 2003
Posts: 24199


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: 15092

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
I agree. Here's the link:
subject: javac Problems
It's not a secret anymore!