[jmsl] score notation printing lilypond linux x11 display variable
jmsl at music.columbia.edu
jmsl at music.columbia.edu
Mon May 9 07:02:53 EDT 2005
Hi Hugo,
Linux needs a graphics context to run Java graphics like those done in
JMSL Score. As Douglas points out, when you are at a terminal doing it
yourself, the screen display gives Java the graphics context it
requires. When you are running it as a cron job, there is no graphics
context and your job dies.
There are two solutions:
1) Use PJA Toolkit to provide Java with a graphics context (
http://www.eteks.com/pja/en/ ). Your java command will require some
startup paramters like I paste below:
/usr/java/jdk1.3.1_06/bin/java -Xbootclasspath/p:./pja_2.4/lib/pja.jar
-Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment
-Dawt.toolkit=com.eteks.awt.PJAToolkit
-Djava.awt.fonts=/usr/java/jdk1.3.1_06/jre/lib/fonts
-Duser.home=./pja_2.4 -classpath ./jmsl.jar:./jscore.jar:whateverelse
mypackage.MyClass
The last time I checked, PJA toolkit worked with jdk 1.3x and not 1.4x
That may have changed. (what version of java is running on your Linux
machine?)
2) Run Java in "headless" mode. Something like:
java -Djava.awt.headless=true -classpath
./jmsl.jar:./jscore.jar:whateverelse mypackage.MyClass
Your can learn more about Headless support at Sun:
http://java.sun.com/j2se/1.4.2/docs/guide/awt/AWTChanges.html#headless
Headless support was new to Java 1.4
One of these two approaches should work for you. Let me know how it goes!
Thanks
Nick Didkovsky
jmsl at music.columbia.edu wrote:
> Now I have a more JMSL - linux question. If I run my JMSL program by
> hand everything goes well. However if I try to run the same program as
> a cron task. (I'm using linux) then I get an interesting error:
>
> starting composition of piece 1115556901770
> creating score...
> Exception in thread "main" java.lang.ExceptionInInitializerError
> at com.softsynth.jmsl.score.Score.<init>(Score.java:59)
> at com.softsynth.jmsl.score.Score.<init>(Score.java:113)
> at com.softsynth.jmsl.score.Score.<init>(Score.java:119)
> at
> org.trebol.metaComposer.test02.MusicGenerator.createScore(MusicGenerator.java:43)
> at
> org.trebol.metaComposer.test02.MetaComposer.<init>(MetaComposer.java:20)
> at
> org.trebol.metaComposer.test02.MetaComposer.main(MetaComposer.java:28)
> Caused by: 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:310)
> at java.awt.Frame.<init>(Frame.java:419)
> at java.awt.Frame.<init>(Frame.java:384)
> at
> com.softsynth.jmsl.score.view.NoteDimensionNameSpaceEditor.<init>(NoteDimensionNameSpaceEditor.java:27)
> at
> com.softsynth.jmsl.score.SelectionBuffer.<clinit>(SelectionBuffer.java:20)
>
> I do not know about this X11 DISPLAY variable but I don't know if the
> solution is in the JMSL part, or in the linux side. Wonder if somebody
> know the area.
>
>
> Well, seem there are a lot of questions. Sorry for that and I would
> appreciate your help guys as usual.
> Thanks
> Hugo
>
>------------------------------------------------------------------------
>
>_______________________________________________
>jmsl mailing list
>jmsl at music.columbia.edu
>http://music.columbia.edu/mailman/listinfo/jmsl
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://music.columbia.edu/pipermail/jmsl/attachments/20050509/086c8c75/attachment.htm
More information about the jmsl
mailing list