Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deploying Java Application

Status
Not open for further replies.

jshanoo

Programmer
Apr 2, 2002
287
IN
Hi ,
I am VB Pro.
But i doing with small mail application.
so whenever i want to execute this program 'somename.class' . i have to install all the jsdk in that machine . then i have open dos prompt and the ggive command like

X:\java somename.class.

is there any provision like in vb , u develop something just install in any remote machine. without installing the complete sdk. I assume that java runs with JVM


Regards
John Philip

*** Even the Best, did the Bad and Made the Best ***

John Philip
 
Not really, Java programs require a JVM to interpret the byte code (.class file) to native machine code.

Having said that, it is possible to create an executable from your .class file, but I know nothing about it. Search google for "Java executable" or something like that.
 
There are fairly expensive java compilers out there that generate native assmebly and then assemble the code to an executable binary file (read: exe).

What most java developers do is list the JVM as a system requirement and then include a batch file for windows users (with an custom icon) so the user doesn't have to open DOS or bother re-typing "java somename" each time they want run the program, they just click on the icon or shortcut. And also include a shell script for *nix users.
 
jstreich :

Well thats all good and well, but you still require a JVM for that.

There are plenty of free tools that will create a machine code exe from class files out there ...
 
Hi all,
Can any plz specify any application in particular

regards
John

*** Even the Best, did the Bad and Made the Best ***

John Philip
 
Never used them - google for it, and try a few out ...
 
Without a GUI, you could use GCJ, GNU's java compiler (for *nix systems); but it doesn't suport AWT or SWING yet. MS's J++ should (in theory) handle java for Dos/Windows -- but it might be too messy (or may require you to change a lot of GUI code). Try seraching sourceforge, and save yourself a pretty penny.

sedj-
Yes, it still requires the JVM if you aren't compiling to native code... The beauty (or part of the beauty) of java is compile once run anywhere (that has a JVM). Most java apps that released in the Open Source world just list the JVM as a system requirement of their software (instead of a spesific OS), and I think that is perfectly reasonable.
 
jstreich :

I'm perfectly aware of Java's "write once run anywhere" capabilities (as long as there is a JVM, the JVM version is the same as the SDK that the code was compiled on etc etc etc).

Then jist that I got from jshanoo 's original post was that he did not wish to install any SDK or JVM, but wanted a standalone exe that could just be compiled for a specific platform and then just run without any JVM hassles ...
 
Better way would be to use an installation tool to create an installer that installs a JRE is none is found on the target machine, just as the installation tool that comes with VB will install the VB runtime on the client machine if none is found.

Most VB programmers aren't even aware that Windows Installer does this (as does Installshield and Wise)...
 
Hi jwenting,
I am not clear on your post.
I know that java needs only JVM in any machine, so simply compiling the code to executable will run the class?


Regards
John

*** Even the Best, did the Bad and Made the Best ***

John Philip
 
He means that in your deployment script (of your java app), the first thing you do is check for the existence of a JRE (by doing "java" in a batch file or something and seeing what the output is, or by using some other language to interrogate the registry), and if there is no JRE, then forcing an installation.

Personnally I think this is frought with danger.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top