Programs written in Eclipse dont behave as they should

Asked by jobsonandrew

im using Ubuntu 7.04 and I Have had JRE and JDK 6 installed (I recently went back to java 5 to try to solve this problem)

When I write a simple Java program in Eclipse consisting of a GUI with a button on it, the window shows up but the button doesn't appear on the GUI.. I have run the same code on windows and it works as it should. I have installed Eclipse using 'Add/Remove' and installed Java in the normal way.. Does anyone know what could be causing this problem?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
jobsonandrew
Solved:
Last query:
Last reply:
Revision history for this message
Ralph Janke (txwikinger) said :
#1

Thanks for the question.

Sun java might not be set as your default java jre. You can select the default with

sudo update-alternatives --config java

You should also change the priority of your preferred jvm by putting it at the top in

/etc/jvm

More information can be found at https://help.ubuntu.com/community/Java
I hope this helps.

Revision history for this message
jobsonandrew (jobsonandrew) said :
#2

I have reinstalled JRE and JDK 6 and I have changed the default JRE to be:
/usr/lib/jvm/java-6-sun/jre/bin/java

and in /etc/jvm is:

    # This file defines the default system JVM search order. Each
    # JVM should list their JAVA_HOME compatible directory in this file.
    # The default system JVM is the first one available from top to
    # bottom.

    /usr/lib/jvm/java-6-sun
    /usr/lib/jvm/java-1.5.0-sun
    /usr
    /usr/lib/jvm/java-gcj
    /usr/lib/jvm/ia32-java-1.5.0-sun

and the program I have written still doesn't work correctly

Revision history for this message
Best jobsonandrew (jobsonandrew) said :
#3

I solved the problem by preventing the Beryl Window decorator from starting with the computer.. it seems to have been causing the problem, because now my GUI elements show up as they should :)