• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

javac Problems

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic