Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Java unix executable

Posted on 2000-03-15
4
Medium Priority
?
333 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 150 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

647 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