• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Compiler Gremlin

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trying to help Michelle with a bug that popped up out of nowhere. JDK1.3 was up and running, had compiled a number of times. All of a sudden, with no changes to anything that we know of, compiler won't even compile "HelloWorld". Error returned is:

It appears the compiler can't find some basic classes. I went over PATH and CLASSPATH environment variables with a fine-toothed comb. Obviously, the compiler is running, since it gives an error. I uninstalled the JDK and the JVM and reinstalled them twice. I did notice that while uninstalled, there are still a lot of keys in the registry with the word 'java' in them.
Finally, I tried doing 'cd c:\jdk1.3\lib' from the DOS prompt, and running javac from within the 'lib' folder. It worked! But even adding c:\jdk1.3\lib to the PATH and CLASSPATH statements won't help. You actually have to run javac from within the 'lib' folder.
If I had to guess, I'd say it might be some leftover hoodoo in the registry, but what? Tried to find a Sun page that might shed some light, but this appears to be too fundamental for their forum. Any ideas?
System is Pentium III with 128MB ram, W98.
 
Sheriff
Posts: 9099
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hopefully it is --
public static void main( String[] args ) and not --
public static void Main( String[] args ) like you wrote.

I would think so since you said it worked when you cd'd to the lib subdirectory. Does the same symptom happen with every java application compiled on that computer? What about running them?

As far as the java references left over, I think some of these are remnants of when MS was still including java stuff in their programs. I have some folders under
C:\windows\java\
named classes, packages, packages\data, and trustlib

And you restarted the computer each time you changed the autoexec.bat PATH and CLASSPATH settings, right?


[This message has been edited by Marilyn deQueiroz (edited December 20, 2000).]
 
Marilyn de Queiroz
Sheriff
Posts: 9099
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can get that error if I put an extra closing curly brace between the class declaration and the main() statement, like so:

 
JC Cook
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the "main vs. Main" typo. The file was fine, and did compile on another set. Other files all behave the same way -- will compile from the ...\lib folder, otherwise will not compile.
The workstation is over at my office, so I'll look for those Windows folders tomorrow. And yes, I did restart between loads and unloads.
I'm pretty sure it's a registry key or some other startup parameter, but I have no idea how to determine which one or where.
 
JC Cook
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, here's an update.
I went through the most detailed un-/re-install I could think of:

  1. Uninstalled JVM
  2. Rebooted
  3. Uninstalled JDK 1.3
  4. Rebooted
  5. Turned off all Java in IE (since remaining registry entries were all for MS)
  6. Rebooted
  7. Turned off all Java in Netscape Communicator
  8. Rebooted
  9. Held down shift key during reboot to minimize the number of startup dlls that might load
  10. Reinstalled JDK1.3
  11. Rebooted (whew!)

  12. Result: no change. Will compile from within c:\jdk1.3\lib, but will not compile from anywhere else.
    I'm out of ideas. Marilyn, is there a chance you could (please!) copy these messages to any/all forum strings where you think I might get some help. (None of them looks right to me for this problem.)
    Here's a little more info:
    Actual source is
    Verbose compiler response is
    Suggestions warmly welcomed.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't suppose there's another "String.java" file on the machine? Say, in the "." directory (the one you are running javac from)? The error does claim to come from ".\String.java:1" after all.
 
JC Cook
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JC's second rule: It's hard to see things under our noses.
You were close enough, Jim. She had save a snippet of code in the source folder saved as String.java. Many thanks for taking the time to respond.
PS. If anyone needs help installing the JDK, I've gotten pretty good at it.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic