This discussion is archived
1 Reply Latest reply: Mar 15, 2013 5:51 PM by Gary Graham RSS

headless sql developer - format.sh

997189 Newbie
Currently Being Moderated
Hey All.

We have a lot of plsql code that isn't formatted consistently. We're trying to use format.sh that's shipped with sql developer from the command line.

I've tried -Djava.awt.headless=true, but wasn't quite sure how to use it.
I've tried setting DISPLAY to 0, 0.0, and localhost:0.0 and nothing seem to work.

I can get format.bat to work on windows xp just fine. Any ideas? Thanks.

format.sh input=<infile> output=<outfile>

Oracle SQL Developer
Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.

java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
at java.awt.Window.<init>(Window.java:432)
at java.awt.Frame.<init>(Frame.java:403)
at javax.swing.JFrame.<init>(JFrame.java:202)
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:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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)
  • 1. Re: headless sql developer - format.sh
    Gary Graham Expert
    Currently Being Moderated
    Hi,

    Keep in mind that 0.0 represents the main console which you may not even be at. For example, I can start multiple vncserver sessions, one at :1, another at :3, then depending on which I connect to ...
    1. env | grep DISPLAY will show either :1.0 or :3.0
    2. who output should also show which display each <userid> pts/<n> points to.
    Similar considerations if you connect via ssh -X <hostname>.

    And how you set the display depends on your shell. For example, if it is not set and you wish to display to :1...
    1. export DISPLAY=:1.0 for bash-like shells (bash, sh, etc)
    2. setenv DISPLAY :1.0 for C shell based shells (csh, tcsh, etc)
    Hope this helps,
    Gary

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points