GeeCON Prague 2014*
The moose likes IDEs, Version Control and other tools and the fly likes problems with code display in Eclipse Indigo 3.7 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "problems with code display in Eclipse Indigo 3.7" Watch "problems with code display in Eclipse Indigo 3.7" New topic
Author

problems with code display in Eclipse Indigo 3.7

Benjamin Weaver
Ranch Hand

Joined: Apr 08, 2003
Posts: 161
I used Eclipse 3.2 and 3.3 heavily until about Java 1.6.07, on a large project with lots of classes. Now, after a year or so, I want to use Eclipse Indigo 3.7 with a recent Java release. First I tried Java 1.7, now 1.6.0_27.

No matter which of these versions I use, I get the same problem. I create a New Java Project and create a new class, say 'AClass'. I create the class with or without a package. The code generated for a main method does not include 'public static' in front of it. Nor does the class name follow 'public' even though I specify on creation that this is a public class. Then, when I attempt to type in the GUI, the word 'public' disappears from view, and a vertical cursor begins blinking in my code window. I have never seen problems of this kind in Eclipse, and what I am attempting is as simple as it gets.

I have removed earlier Java versions, and rebooted my machine.

Any ideas? They would be greatly appreciated.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

I have never seen this, and I have used dozens of different version of Eclipse. Exactly which Eclipse package did you download? And did you install it in a new location? Also, what version of the JDK is Eclipse running in? And what OS are you using?

I would check that the default version of Java is at least a recent 1.6 version (1.6.0_26 or higher). I would also reinstall Eclipse, downloading the Eclipse IDE for Java Developers, or Eclipse IDE for Java EE Developers package.


JBoss In Action
Benjamin Weaver
Ranch Hand

Joined: Apr 08, 2003
Posts: 161
Thanks for thes hints. This is a huge problem (all so very basic, maybe some configuration problem):
os: Windows XP
current Java 1.6.0_30 (oracle SE) --it is now the only Java installed
Eclipse: tried both Indigo and Helios, reinstalling several times (unpacking with 7-zip to prevent corruption)
have removed all previous Java versions, all previous Java Image Processing Packages--and check to insure that all java registry entries are correct--which they now are.

Am running Firefox 10.0

Still, I get the same set of errors in eclipse: (is it some kind of keyboard-configuration error??) the error lies with the Java edit window
project appears to create normally.
1. if create Class, with public main method
a. word public does not appear
b. if type word 'public' the characters do not appear for this this word--usually the whole word disappears.
c. when shutdown eclipse and bring it up again, and on all subsequent restarts of eclipse, edit screen is light blue, with the appropriate error indicators showing errors in the code, but when I try to navigate to the errors to fix them, or for that matter navigate anywhere in the window, no characters are displayed. --even though if I reboot machine--and bring up eclipse again--the code will appear again as in a. and b. above.
So: partial functionality of edit window on first start of eclipse; less functionality (elimination of characters from view) on subsequent restarts.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

I wonder if there is some bad interaction between XP and JDK 1.6.0_30 I've seen similar issues, though usually with beta versions of the OS. I suggest trying this on another computer, or trying an older version of the JDK. (Some of my colleagues have had issues with JDKs after 1.6.0_26).
Benjamin Weaver
Ranch Hand

Joined: Apr 08, 2003
Posts: 161
A possible clue!

Had tried a few times with Eclipse--same result. For time being switched to running eclipse on a linux vm via Oracle Virtual Box.

However, tonight, after banging on the keys with the same result, the eclipse code editor threw out an exception that seemed relevant. Any ideas and interpretations are welcome!


Eclipse reports this Message:

Problems occurred when invoking code from plug-in: "org.eclipse.jface".

followed by an Exception Stack Trace:




Yup. These errors make sense, the calculation of area, the cursor, its size, etc.

There is nothing in my classpath to create a conflict--I have stripped it down. Also, this error occurs in all versions of Java so far as I can tell from 1.5.0_22 --1.7.

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

There is nothing in my classpath to create a conflict

Actually, you should never set CLASSPATH, that is a sure way to shoot yourself in the foot. Instead, always pass the -classpath setting to the JVM.

But the idea of a stray JAR file in the classpath gives me an idea. Add this line to the end of the eclipse.ini file:

-verbose:class

Then run eclipsec.exe (not eclipse.exe). This version of the Eclipse launcher will open a command prompt window and the -verbose:class option will cause the JVM to list each class loaded and the JAR it came from. Run like this from a command line:

eclipsec.exe > eclipse.log 2>&1

then all output will go into the eclipse.log file. What you are looking for is any classes that are loaded from a location other than rt.jar or from a subdirectory within Eclipse. Be especially aware of JARs loaded from an "endorsed" directory.
Benjamin Weaver
Ranch Hand

Joined: Apr 08, 2003
Posts: 161
Thanks, Peter,

I checked out that log file I generated using your suggestion. I could not identify any obvious suspect classes. It is true I did not check every last one line by line--a lot of classes are loaded! I might have a better look again tomorrow, and I might also scan my c: drive for rogue Java classes. Hmph.





Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Do you have an editor with a macro capability? I usually use it to delete all of the lines that contain classes from rt.jar and from the Eclipse directory. Then there are very few lines left.

One other thought - did you install any plugins into Eclipse? If so, try a clean install without plugins and see if you get the same thing.

But my money is still on the interaction between the JVM and the Windows graphic/windowing DLLs, with a Windows DLL being the most suspect. Perhaps Process Explorer from sysinternals could shed some light on that - it will list all DLLs loaded by Eclipse. Of course, you would have to compare the DLL list with someone on the exact same version of Windows as you (including service packages, possibly also patches) and whose Eclipse setup is working without issue.
Benjamin Weaver
Ranch Hand

Joined: Apr 08, 2003
Posts: 161
I made that eclipse.log as you suggested, then moved it to my Linux, and removed all those lines for eclipse and rt.jar paths as you suggested. Indeed I was left with a short file, which I could easily check. Nothing looked unusual.

I might agree with you that this is a dll problem. I downloaded process explorer, but as you say, you get a long list of dlls without knowing which might be amiss.

I have wondered whether Oracle Virtual Box or the latest Firefox could have introduced the problem, perhaps with their dlls. But I don't know that much about dlls; perhaps new ones were installed by windows update routines, etc.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

I use Firefox and VirtualBox on my systems, so it isn't them. Most likely a bad Windows update caused this issue. Or perhaps a bad video driver? If you let Windows Update update you video driver, uou might want to go to the manufacturer's web site and get the latest video driver from there.
 
GeeCON Prague 2014
 
subject: problems with code display in Eclipse Indigo 3.7