11 Replies Latest reply: Jul 25, 2012 4:28 PM by stuartu RSS

    SQL Developer on Ubuntu

    RKYMTNSTEEL
      I have installed sqldeveloper on Unbuntu and can't find any information on java.awt.headless exception that relates to sqldeveloper! Has anyone had this problem and found resolution?
        • 1. Re: SQL Developer on Ubuntu
          Jim Smith
          You need to provide more information.

          What version of SQL Developer?
          What JDK?
          What are you doing which produces the error?
          • 2. Re: SQL Developer on Ubuntu
            Irian
            Headless normally means you are running without a monitor; SQLDeveloper has some limited command line functions, but if you want to run the full application you need to have a graphics environment of some sort (in linux an accessible X11 session).

            Probably you are trying to start SQLDeveloper from a shell where there is no graphics environment available, check if this is the case and if it's still not working provide more information as Jim said.
            • 3. Re: SQL Developer on Ubuntu
              RKYMTNSTEEL
              I am running 3.1.07.42 (linux) and am on java-6-openjdk. I am getting the headless exception just launching SQL Developer!
              • 4. Re: SQL Developer on Ubuntu
                RKYMTNSTEEL
                P.S., Other java apps run just fine with the current Java. My SQL Developer stopped working when a co-worker installed Eclipse Indigo with the Toad extension, but I don't see how that could have done anything! But what do I know, I am posting to the forum!
                • 5. Re: SQL Developer on Ubuntu
                  Gary Graham-Oracle
                  Hi,

                  I recall an issue (unrelated to yours) with Open JDK on Windows where the workaround required avoiding sqldeveloperW.exe and launching SQL Developer directly via the java.exe.

                  As for Java issues, just to be absolutely sure, you may want to try installing the latest (Oracle) jdk in the 1.6.x series for your platform. Point your SetJavaHome line in sqldeveloper.conf to it. Note that SQL Developer is not certified on 1.7. But aside from any 1.6 versus 1.7 issues, I imagine Open JDK should be fine.

                  Also, it probably wouldn't hurt to post the stack trace with the exception here.

                  Regards,
                  Gary
                  SQL Developer Team
                  • 6. Re: SQL Developer on Ubuntu
                    Gary Graham-Oracle
                    Actually, upon reflection, I like Irian's answer. The java.awt.HeadlessException could also apply to some issue with the keyboard or mouse, but it's most commonly associated with lack of a graphics environment. I tried running sqldeveloper.sh on Linux after setting my DISPLAY environment variable to null and got some other exception, not the HeadlessException.

                    Since SQL Developer stopped working after your environment changed, you might try seeing what impact an Eclipse Indigo install has on another machine's environment variables by doing a before and after comparison.

                    -Gary
                    • 7. Re: SQL Developer on Ubuntu
                      zaferaktan
                      I have been using SqlDeveloper on Ubuntu for years and never had the issue you are having.
                      Currently I am using Ubuntu 10.04 LTS version on my workstation and 11.10 on my laptop (both 64bit). Both has SqlDeveloper (latest 3.1 version) installation - working with the latest Oracle JDK (not open source version).

                      I see your kernel version is not the standard, sounds like you either updated your kernel yourself on 11.10 (my kernel version on 11.10 is 3.0.0-17-generic) or you are using earlier 12.04 beta release. using Open JDK is certainly not recommended. Try using Oracle JDK - latest version with latest SqlDeveloper, see it will fix your problem. If you are using 12.04 beta, recommend you to update to the official release (kernel updated to 3.2).
                      • 8. Re: SQL Developer on Ubuntu
                        RKYMTNSTEEL
                        Here is the exception thread to the error

                        java.awt.HeadlessException
                             at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173)
                             at java.awt.Window.<init>(Window.java:476)
                             at java.awt.Frame.<init>(Frame.java:419)
                             at javax.swing.JFrame.<init>(JFrame.java:218)
                             at oracle.ide.IdeCore$StartupWindow.<init>(IdeCore.java:1960)
                             at oracle.ide.IdeCore.startupImpl(IdeCore.java:1148)
                             at oracle.ide.Ide.startup(Ide.java:703)
                             at oracle.ideimpl.DefaultIdeStarter.startIde(DefaultIdeStarter.java:35)
                             at oracle.ideimpl.Main.start(Main.java:184)
                             at oracle.ideimpl.Main.main(Main.java:146)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                             at java.lang.reflect.Method.invoke(Method.java:616)
                             at oracle.ide.boot.PCLMain.callMain(PCLMain.java:62)
                             at oracle.ide.boot.PCLMain.main(PCLMain.java:54)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                             at java.lang.reflect.Method.invoke(Method.java:616)
                             at oracle.classloader.util.MainClass.invoke(MainClass.java:128)
                             at oracle.ide.boot.IdeLauncher.bootClassLoadersAndMain(IdeLauncher.java:189)
                             at oracle.ide.boot.IdeLauncher.launchImpl(IdeLauncher.java:89)
                             at oracle.ide.boot.IdeLauncher.launch(IdeLauncher.java:65)
                             at oracle.ide.boot.IdeLauncher.main(IdeLauncher.java:54)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                             at java.lang.reflect.Method.invoke(Method.java:616)
                             at oracle.ide.boot.Launcher.invokeMain(Launcher.java:713)
                             at oracle.ide.boot.Launcher.launchImpl(Launcher.java:115)
                             at oracle.ide.boot.Launcher.launch(Launcher.java:68)
                             at oracle.ide.boot.Launcher.main(Launcher.java:57)
                        • 9. Re: SQL Developer on Ubuntu
                          zaferaktan
                          I recently updated my 11.10 (64bit) to 12.04 LTS (64bit) - the kernel version now is 3.2.0-24-generic. SqlDeveloper (latest 3.1 version) with Sun JDK (not Open JDK) works just fine. No errors/exceptions at all. Just wanted to let you know. You can try SqlDeveloper on a VM that is running the latest 12.04 and see if you can duplicate. OpenJDK might be the culprit in your case. Sounds like yours is not generic issue.
                          • 10. Re: SQL Developer on Ubuntu
                            951581
                            Hello,
                            I have the same problem.
                            I think I installed sql developer but I am not be able to sure it was installed or not. Ubuntu is so weird, there is no even a shortcut or something like that... If it is installed, I dont know how to run it. Is this a secret?
                            (If windows is market leader, the cause is so explicit.)
                            • 11. Re: SQL Developer on Ubuntu
                              stuartu
                              948578 wrote:
                              Hello,
                              I have the same problem.
                              I think I installed sql developer but I am not be able to sure it was installed or not. Ubuntu is so weird, there is no even a shortcut or something like that... If it is installed, I dont know how to run it. Is this a secret?
                              (If windows is market leader, the cause is so explicit.)
                              No Ubuntu or SQL Developer version,.... not at all helpful.

                              Like zaferaktan, I've been using Ubuntu and SQL Developer for years without any issue (10.10, and more recently 12.04). Did you try installing the Oracle JDK as mentioned above?

                              You will get prompted for the location of java when you first run SQL Developer (it will be under the 'Programming' menu). If not, then Control-Alt-T, look for the sqldeveloper.sh (probably under /opt/sqldeveloper) and invoke it manually to get the popup. Googling on how to install on Ubuntu, including the installation of Oracle JDK will bring up a few blogs... it isn't rocket science.