PreviousNextTracker indexSee it online !

(71/231) 2729908 - Can only supply eight files on command line

Running linux, jedit 4.3pre16.

I am seeing that jedit will only open the first eight files I supply to it on the command line. If I supply any more than that, the files after the first eight, are simply not opened.

I can open as many as I want, using the mouse (directory/file browser), once I am in the editor. Unfortunately I often need to supply a large number of files on the command line.

This behavior did not occur in 4.2. In 4.2 you can supply as many files as you want on the command line, and they all get opened. So if I want to open more than 8 files on the command line, I use 4.2.

Submitted mtgavin - 2009-04-04 - 05:07:56z Assigned nobody
Priority 5 Category editor core
Status Open Group None
Resolution None Visibility No


2009-04-04 - 14:06:46z
What is the command-line that you use to launch jEdit with a specified list of files?
2009-04-04 - 15:59:43z
Nothing out of the ordinary (I don't think, anyway.)

jedit <file1> <file2> <file3>..... <file_n>

I also do stuff like 'jedit *.txt' so the wildcrad matches a (potentially large) number of text files..

Neither one will load anything more than the first eight files specified.

This is consistent behavior with 4.3pre16 - happens to me EVERY time - you should be able to reproduce this quickly. If you are not able to reproduce this quickly then this could be difficult to isolate. Again, this worked flawlessly with 4.2.
2009-07-26 - 15:19:50z
I have been having trouble dupicating the problem. mtgavin, what operating system are you running on? I am running Linux, more specifically the deltah version of Gnewsense, which is heavily based on Ubuntu Hardy. My shell is bash 3.2.33. With both 4.3.pre13 and 4.3.pre18, I can load more than eight files from the command line, with either method you mention, either wildcard or explicitly. If you're running on a UNIX, what shell are you using? I assume you're not running this from a MacOS X command line or an MS-DOS prompt or the like. Since you're running this as "jedit" and not "java -jar jedit.jar", I assume you're using the jedit installed by the OS flavor's package. When I do a "which jedit" it shows /usr/bin/jedit as my shell script, when I do a "tail -1 /usr/bin/jedit" it says

exec $JAVA -Xms${JAVA_HEAP_INIT_SIZE}M -Xmx${JAVA_HEAP_MAX_SIZE}M -jar /usr/share/jedit/jedit.jar -reuseview "$@" &

That "$@" at the end means pass all arguments passed to this shell script, which is part of what allows me to load 9, 10, 11 files from the command line.
2009-07-26 - 15:32:19z
Works fine for me, windows XP.

Here is the contents of the batch file I use:
start /b javaw -cp "C:\Documents and Settings\djohnson\workspace\jEdit\build\jedit.jar;C:\jEdit\build\looks.jar" -Xmx256M org.gjt.sp.jedit.jEdit -reuseview %*
2009-07-26 - 18:36:25z
If jEdit only opens 8 files from the command-line, it's probably due to the batch file (or alias?) named 'jedit'. Please add the contents of this alias / batch file.
In Linux you can usually get this using: cat `which jedit`
2009-08-02 - 04:29:13z
After reading Dennis post, dated 2009-07-26 15:19, and shlomy: you are right, the problem was in my jedit script, very similar to what Dennis described.

Somehow my jedit invocation script (looks very similar to Dennis' post) changed from 4.2 to 4.3, to only call out 9 params ($1...$9) in the 4.3 version. This 4.3 version did not use the $@ parameter. I would not have modified that so I think this may bear some investigation on your end, as to how that could have happened. I suspect that the 4,3 package I downloaded may have had this mod in it.

So please take a look at the jedit invocation script supplied by your linux install tarball, and double-check that it is still using $@. Once you clarify that you can close this. Thanks for the help.
2009-08-02 - 05:24:56z
Can you attach your jEdit invocation script?
Mine has the following, which is fine, because it invokes jEdit with "-reuseView" multiple times if there are more than 9 arguments on the command-line:

while [ $# -gt 9 ]; do
exec "$JAVA_HOME/bin/java" -Xmx${JAVA_HEAP_MAX_SIZE}M -jar /mnt/home/sreinste/jedit/4.3pre16/jedit.jar -reuseview "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9"
shift 9
2009-08-02 - 18:20:25z
shlomy - my script is identical to yours. On my linux system (Red Hat Enterprise release 4, Nahant Update 4), after it executes the first iteration of the 'while' loop (brings up jedit, with 9 files) it does not do anything else. So, it blocks after the first instance of the 'while' loop, leaving me with only the first 9 files open. I am not sure why the script is trying to do things this way, it seems to be much simpler to use the $@ parameter. What are we intending to accomplish with this looping? How is this better than simply using the $@ parameter, as dennis_shell indicated?
2009-08-02 - 19:22:53z
You're missing a & in your batch file:

you said your batch file was this:
exec "$JAVA_HOME/bin/java" -Xmx${JAVA_HEAP_MAX_SIZE}M -jar
/mnt/home/sreinste/jedit/4.3pre16/jedit.jar -reuseview "$1" "$2" "$3" "$4"
"$5" "$6" "$7" "$8" "$9"

This will work fine if there is already a view active. Otherwise, it will keep control of the shell until it exits.
So you need to add a & at the end of the line.

2009-08-02 - 19:31:14z
That's not a custom batch file - it's the one that the installer creates, I think in this case the copy in the repository shoult be changed.
2009-08-02 - 20:08:37z
Yes, I guess it's a bug in the installer script generation code of jedit core.
We need to add an &
2009-08-03 - 00:21:10z
If you plan on adding an ampersand (&) after the exec call to jedit, please make sure it works. I tried adding the ampersand to the end of the exec call. When you do this, if jedit isn't already open, it does not work as intended -it opens ('numfiles' mod 9) versions of jedit (not just one), each with nine open files.
2009-08-03 - 00:22:30z
Opps, meant that it adds 'numfiles / 9' (not mod 9) versions of jedit. Sorry.