Hi,
I've just upgraded the standard Java bundle and TM's support lib for executor stuff.
I have the following tiny java script:
import java.io.*; public class test { public static void main(String args[]){ System.out.println("Hello World"); } }
saved as test.java
If I compile and run it on a console, no problem. If I use the Java bundle's "Compile & Run" I get this:
/Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/ executor.rb:87:in `run': undefined method `call' for nil:NilClass (NoMethodError) from /Applications/TextMate.app/Contents/SharedSupport/ Support/lib/io.rb:41:in `call' from /Applications/TextMate.app/ Contents/SharedSupport/Support/lib/io.rb:41:in `exhaust' from / Applications/TextMate.app/Contents/SharedSupport/Support/lib/io.rb: 41:in `each_line' from /Applications/TextMate.app/Contents/ SharedSupport/Support/lib/io.rb:41:in `exhaust' from /Applications/ TextMate.app/Contents/SharedSupport/Support/lib/tm/process.rb:165:in `run' from /Applications/TextMate.app/Contents/SharedSupport/Support/ lib/tm/executor.rb:99:in `run' from /Applications/TextMate.app/ Contents/SharedSupport/Support/lib/tm/executor.rb:198:in `process_output_wrapper' from /Applications/TextMate.app/Contents/ SharedSupport/Support/lib/tm/executor.rb:98:in `run' from / Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/ htmloutput.rb:134:in `call' from /Applications/TextMate.app/Contents/ SharedSupport/Support/lib/tm/htmloutput.rb:134:in `show' from / Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/ executor.rb:83:in `run' from /Applications/TextMate.app/Contents/ SharedSupport/Bundles/Java.tmbundle/Support/bin/javamate.rb:32
I didn't set up any env variables. I'm running a Intel MacOSX 10.5.4 (very fast;) with TM Version 1.5.7 (1466)
With the 'old' Java bundle ("Compile & Run single script") it works.
Any help available?
The new bundle has a nice feature. "Compile & Run (with args)" I couldn't try out it yet but if I have a folder containing my Java script and aFile, and I want to do something with that aFile. Is it possible to enter only the filename aFile as argument without the absolute path. In other words, does run the script in that folder?
Many thanks in advance,
--Hans
Will look at this tomorrow.
On 29/08/2008, at 5:09 PM, Hans-Jörg Bibiko wrote:
Hi,
I've just upgraded the standard Java bundle and TM's support lib for executor stuff.
I have the following tiny java script:
import java.io.*; public class test { public static void main(String args[]){ System.out.println("Hello World"); } }
saved as test.java
If I compile and run it on a console, no problem. If I use the Java bundle's "Compile & Run" I get this:
/Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/ executor.rb:87:in `run': undefined method `call' for nil:NilClass (NoMethodError) from /Applications/TextMate.app/Contents/ SharedSupport/ Support/lib/io.rb:41:in `call' from /Applications/TextMate.app/ Contents/SharedSupport/Support/lib/io.rb:41:in `exhaust' from / Applications/TextMate.app/Contents/SharedSupport/Support/lib/io.rb: 41:in `each_line' from /Applications/TextMate.app/Contents/ SharedSupport/Support/lib/io.rb:41:in `exhaust' from /Applications/ TextMate.app/Contents/SharedSupport/Support/lib/tm/process.rb:165:in `run' from /Applications/TextMate.app/Contents/SharedSupport/Support/ lib/tm/executor.rb:99:in `run' from /Applications/TextMate.app/ Contents/SharedSupport/Support/lib/tm/executor.rb:198:in `process_output_wrapper' from /Applications/TextMate.app/Contents/ SharedSupport/Support/lib/tm/executor.rb:98:in `run' from / Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/ htmloutput.rb:134:in `call' from /Applications/TextMate.app/Contents/ SharedSupport/Support/lib/tm/htmloutput.rb:134:in `show' from / Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/ executor.rb:83:in `run' from /Applications/TextMate.app/Contents/ SharedSupport/Bundles/Java.tmbundle/Support/bin/javamate.rb:32
I didn't set up any env variables. I'm running a Intel MacOSX 10.5.4 (very fast;) with TM Version 1.5.7 (1466)
With the 'old' Java bundle ("Compile & Run single script") it works.
Any help available?
The new bundle has a nice feature. "Compile & Run (with args)" I couldn't try out it yet but if I have a folder containing my Java script and aFile, and I want to do something with that aFile. Is it possible to enter only the filename aFile as argument without the absolute path. In other words, does run the script in that folder?
Many thanks in advance,
--Hans
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
--
LD.
On 29/08/2008, at 5:09 PM, Hans-Jörg Bibiko wrote:
If I compile and run it on a console, no problem. If I use the Java bundle's "Compile & Run" I get this:
Was a bug in executor, update support and it should work.
The new bundle has a nice feature. "Compile & Run (with args)" I couldn't try out it yet but if I have a folder containing my Java script and aFile, and I want to do something with that aFile. Is it possible to enter only the filename aFile as argument without the absolute path. In other words, does run the script in that folder?
TM sets the working directory to that of the current file when executing commands, so this should work for you. I think this also means that you could create a .classpath file in the same dir as your script if you need to bring in extra jars.
--
LD.
On 30.08.2008, at 05:25, Luke Daley wrote:
On 29/08/2008, at 5:09 PM, Hans-Jörg Bibiko wrote:
If I compile and run it on a console, no problem. If I use the Java bundle's "Compile & Run" I get this:
Was a bug in executor, update support and it should work.
Thanks! Now it works like charm.
The new bundle has a nice feature. "Compile & Run (with args)" I couldn't try out it yet but if I have a folder containing my Java script and aFile, and I want to do something with that aFile. Is it possible to enter only the filename aFile as argument without the absolute path. In other words, does run the script in that folder?
TM sets the working directory to that of the current file when executing commands, so this should work for you. I think this also means that you could create a .classpath file in the same dir as your script if you need to bring in extra jars.
Hmm, id doesn't work for me. I always have to enter the absolute path. I looked at the source code and the tricky point is in java_compile_and_run.sh line 13 This line changes the directory to /tmp/tm_javamate. executor will be invoked after this thus executor will set the working dir to /tmp/ tm_javamate.
I do not have an ad hoc solution, but maybe one could detect if the Java script doc is untitled go head with /tmp/tm_javamate; if not uses TM_FILEPATH as working directory.
Cheers,
--Hans
On 02.09.2008, at 09:26, Hans-Jörg Bibiko wrote:
TM sets the working directory to that of the current file when executing commands, so this should work for you. I think this also means that you could create a .classpath file in the same dir as your script if you need to bring in extra jars.
Hmm, id doesn't work for me. I always have to enter the absolute path. I looked at the source code and the tricky point is in java_compile_and_run.sh line 13 This line changes the directory to /tmp/tm_javamate. executor will be invoked after this thus executor will set the working dir to /tmp/ tm_javamate.
I do not have an ad hoc solution, but maybe one could detect if the Java script doc is untitled go head with /tmp/tm_javamate; if not uses TM_FILEPATH as working directory.
BTW this should be the default way. Otherwise if have no chance to get my *.class files.
Up to now the TM script for compile & run always asks the user to save that file in beforehand if untitled, thus one only needs to change in
java_compile_and_run line 11 to
TMP=${TM_DIRECTORY} # mkdir -p "$TMP"
Cheers,
--Hans
On 02/09/2008, at 6:42 PM, Hans-Jörg Bibiko wrote:
On 02.09.2008, at 09:26, Hans-Jörg Bibiko wrote:
TM sets the working directory to that of the current file when executing commands, so this should work for you. I think this also means that you could create a .classpath file in the same dir as your script if you need to bring in extra jars.
Hmm, id doesn't work for me. I always have to enter the absolute path. I looked at the source code and the tricky point is in java_compile_and_run.sh line 13 This line changes the directory to /tmp/tm_javamate. executor will be invoked after this thus executor will set the working dir to /tmp/ tm_javamate.
I do not have an ad hoc solution, but maybe one could detect if the Java script doc is untitled go head with /tmp/tm_javamate; if not uses TM_FILEPATH as working directory.
BTW this should be the default way. Otherwise if have no chance to get my *.class files.
This is what I was trying to prevent. But perhaps it is better to dump the class file in the project?
--
LD.
On 02.09.2008, at 11:32, Luke Daley wrote:
On 02/09/2008, at 6:42 PM, Hans-Jörg Bibiko wrote:
On 02.09.2008, at 09:26, Hans-Jörg Bibiko wrote:
TM sets the working directory to that of the current file when executing commands, so this should work for you. I think this also means that you could create a .classpath file in the same dir as your script if you need to bring in extra jars.
Hmm, id doesn't work for me. I always have to enter the absolute path. ...
BTW this should be the default way. Otherwise if have no chance to get my *.class files.
This is what I was trying to prevent. But perhaps it is better to dump the class file in the project?
Do you have any specific reasons for that? Or do you want to avoid having *.class files in TM_DIRECTORY after an error while compiling the source code?
I do not know Java overall, but if javac only generates *.class files then a dump back into TM_DIRECTORY could work.
Cheers,
--Hans