LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-04-2004, 10:57 PM   #1
rmanocha
Member
 
Registered: Oct 2003
Location: Austin,TX
Distribution: Debian SID-->fully content-->Love APT,kernel 2.6.4
Posts: 327

Rep: Reputation: 30
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.
 
Old 03-05-2004, 03:58 PM   #2
aaa
Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 46
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
 
Old 03-06-2004, 02:33 AM   #3
UltimaGuy
Member
 
Registered: Aug 2003
Location: Chennai, India
Distribution: PCLinuxOS .92, FC4
Posts: 840

Rep: Reputation: 31
Or you can use gcj to compile the program into executables

Then the'll run faster too
 
Old 03-06-2004, 03:50 AM   #4
german
Member
 
Registered: Jul 2003
Location: Toronto, Canada
Distribution: Debian etch, Gentoo
Posts: 312

Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running Programs from command line sumguy231 Linux - Software 4 12-17-2004 04:10 PM
launching programs from command line in FS dertien Linux - Software 1 11-26-2004 10:27 AM
Howto run a java-applet in Mozilla? Schmurff Linux - Software 10 03-31-2004 03:40 PM
pppd from command line...howto Crasherz Linux - Networking 1 03-05-2004 11:52 AM
Launching Programs From the Command Line Chryzmo Linux - Software 5 03-03-2004 09:00 PM


All times are GMT -5. The time now is 10:45 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration