run java programs from the command line...howto?
hi guys,
i have written a java program which is basically a port of the famous BSD games fortune. Whenever i have to run the program i have to do: java jfortune <filename> now i was just wondering how i can run this like a normal program(you know the ones which are in /usr/bin) and have it run automatically without having to have the .class file in the same directory and without having to type java. do you think writing a small shell script to do this would work? thanks a lot. |
In the command-line, you may always have to type 'java'. If you want to use the same program regularly, then you can make a script and put it in /usr/bin:
#contents of script java jfortune <filename> In a GUI, you can associate the class files with java |
Or you can use gcj to compile the program into executables :)
Then the'll run faster too ;) |
the hotspot JIT compiler has proven to be faster in cases than native executables, from what I have read... I can't back that up or explain it, but I'm certain I have seen that comment floating around in several places (IE news://comp.java.lang.programmer)
B. |
All times are GMT -5. The time now is 05:09 AM. |