miscellaneous notes

better rendering in help system

From Alan:

> try adding some jvm args to the script that starts jedit:
>
> "-Dawt.useSystemAAFontSettings=on" "-Dswing.aatext=true"
>

Mac OS X

9 June 2006

Vampire provided the following response to the question: how can I run jEdit from the command line on a Mac?

Re: new version of NetBeans plugin for jEdit
Date: Today 06:17:16 am
From: Vampire <Vampire0@g...>

Second: Why do you think I can help? I'm in no means a Mac User.
But you are lucky that I run Mac OS X in a VMware since yesterday.
So I looked if I can see something. I guess you are using the jEdit
Application Bundle so,
if there is already an instance of  jEdit running in server mode (the
default) then it is enough to do:

java -jar /path/to/JAR/jedit.jar -reuseview test/test.java

For opening a new instance with the MacOS-Plugin working you have to do

java -cp /System/Library/Java/:/path/to/JAR/jedit.jar
org.gjt.sp.jedit.jEdit test/test.java

Don't ask me why you can't use the -jar option with Mac, but the
Classpath is not set correctly if you do.
If you use this commandline, then jEdit doesn't look nice, don't uses
the Screen Menu Bar, don't respond to the entries in the Services-Menu, ...
You can use the following line to call jEdit almost like starting the
application bundle:

java -cp /System/Library/Java/:/path/to/JAR/jedit.jar
-Dapple.awt.textantialiasing=true -Dapple.awt.antialiasing=true
-Dapple.laf.useScreenMenuBar=true org.gjt.sp.jedit.jEdit -background
test/test.java

This has the only drawback, that the entries in the Services-menu are
not working and the jEdit-Icon is not shown in the lower bar.
The best way is to just start the application bundle through invoking
the javaApplicationStub

/path/to/jEdit.app/Contents/MacOS/JavaApplicationStub
/absolut/path/to/test/test.java

You have to use absolute paths with that approach, or paths relative to
the location of jEdit.app.
The JavaApplicationStub can have another name (and in future releases
will have). The right file to start is the only one, that is present in
jEdit.app/Contents/MacOS and it is configured in
jEdit.app/Contents/Info.plist under the key CFBundleExecutable.

...

If you use the commandline with JavaApplicationStub, you
have to use absolute file-paths, so I guess the right commandline is:

  /path/to/jEdit.app/Contents/MacOS/JavaApplicationStub
  /absolute/path/to/the/MyApplet/file/MyApplet.java +line:10

If you want to use something like

  jEdit /absolute/path/to/the/MyApplet/file/MyApplet.java +line:10

then just make a symbolic link somewhere in the $PATH, in /usr/bin e. g.
that points to JavaApplicationStub. In next releases the
JavaApplicationStub will be renamed to jEdit, so including
/path/to/jEdit.app/Contents/MacOS in the path will be enough to be able
to call it with the commanline written 2 lines above. But you still have
to use ABSOLUTE file paths. Relative file paths are always calculated
relative to the directory where the jEdit.app folder resides if using
the JavaApplicationStub. Again, don't ask me why, I don't know it, I'm
not familiar with Mac, I just tried and know it is like I said.

later:

> >(There must be a way to put that in a nice neat batch file. Surely,
> > Vampire, you are creating such a thing as part of your work.)
>
> No, I didn't plan to do that. What should be the sense? Where is the
> difference between calling a batch-file and calling JavaApplicationStub?

My mistake. I had been looking at the shell script "ant" uses to launch and was thinking jEdit came with a similar one. It tests for user's OS and takes appropriate action. However, just checked and my jEdit install does have a trivial script (which doesn't do anything significant) but it was supplied by whoever packaged jEdit for Debian Linux.

The only reason to provide something like that is making jEdit easy to use "out of box". (Imagine the Linux or XP user who starts using a Mac and expects jEdit to work the same way.) I thought everyone could type "jedit" at a command line and have it just work. So I'll go back and change the default settings in my little netbeans plugin.