Solved

Java unix executable

Posted on 2000-03-15
4
330 Views
Last Modified: 2008-02-01
Hi
I have created a series of java applications, that reside in my account
on a Solaris box. The problem is that, other people would like to
use these applications as well. Now is there a way to create an executable for them such that
instead of the users (who have no java experience) having
to
$java foo.class
simply copy an executable across
ie to run the program
$foo

Any help would be appreciated
Thanks

0
Comment
Question by:virtuala
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 4

Expert Comment

by:pluim
ID: 2622188
Are the other users on the same machine? If so, just create a shellscript that invokes the program:

#!/bin/ksh
# This will run foo.class
CLASSPATH=$CLASSPATH:/<path_to_foo>
java foo.class

Put the script in a directory which is in the user's path (e.g. /usr/local/bin), or have them copy it to their working directory.

If it has to be on a different machine... that's more tricky. If they are familiar with tar (unlikely), write a shellscript similar to the one above and distribute it with the class file, all in one tar file.

I think you're making life very difficult for yourself though. If a user can type 'foo', they can certainly type 'java foo.class'. Documentation is a wonderful thing, you can't solve everything by code (although I've tried!).

pluim.



0
 

Expert Comment

by:ganeshtnr
ID: 2622295
Hi !
 You can very well write a shell Script for that.  I am typing out a sample.  Just check whether it meets your requirement.
-----cut here----
!#/bin/sh
echo " About to Run $1 class file..."
java $1
-----cut here----
Usage:  if the name of this is say foo, then
$ foo Ganesh
will run the Ganesh class.  Hope this helps!!

Don't forget to do "chmod 700 foo".

Bye
Ganesh
0
 
LVL 8

Expert Comment

by:diakov
ID: 2623267
you can also make an applet and put it on your web page. this way everybpdy can enjoy it.

Nik
0
 
LVL 2

Accepted Solution

by:
azawawi earned 50 total points
ID: 2678009
if you want executables, use The GNU Compiler for the Java  Programming Language found @ http://sourceware.cygnus.com/java/

also it will be faster if performance is an issue...




0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question