Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Java web start packaging?
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Zeroth




PostPosted: Fri Jul 25, 2008 12:59 pm   Post subject: Java web start packaging?

Okay, my job requires I use Java web start to package the final front-end application... except for one issue.

The back end is an executable program, ie, blah.exe or blah.so on *nixes. JNLP only allows one to specify a jar file as a resource, so, how do I package the blah.exe into a .jar file, then extract it for execution via command line?
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Fri Jul 25, 2008 1:44 pm   Post subject: RE:Java web start packaging?

Err...I'm not sure you can. The point of Java for web use is that it provides a sandbox environment to prevent malicious web sites from running malicious code on your computer. This is accomplished by having the trusted JVM interpret code and choose what you're allowed to do (no deleting boot.ini, no echoing password files to the network, etc).

So: if you can manage that, that's screwed up.

I'm also confused by your use of "front end" versus "back end"...if the back end is an .exe, that's fine, since you don't have to distribute it. You just distribute the front end, right?
rizzix




PostPosted: Fri Jul 25, 2008 4:19 pm   Post subject: RE:Java web start packaging?

There might be a way to bundle the .exe's and .so's into the Jar.
Zeroth




PostPosted: Fri Jul 25, 2008 5:06 pm   Post subject: Re: Java web start packaging?

Well, its two separate applications. One was written a couple of years ago, and what I've written is just a user friendly GUI over top of that program, which is all command-line based.I know its semi-possible to pull out a .exe from a Jar, but how do I package stuff as Jars?
btiffin




PostPosted: Fri Jul 25, 2008 6:04 pm   Post subject: Re: Java web start packaging?

The packaging will be the easy part

$ jar cmf manifest.txt yourclassfile theexefile

But, as already stated, JARs will not call and execute foreign binaries. You'll have to include a separate extract to somewhere then a system call to the exe. You'll be fighting the Java sandbox the whole time, so be prepared for Dragons.

Zeroth; this is another one of those times I feel like I'm talking down to a guru, but just in case ...
http://java.sun.com/docs/books/tutorial/deployment/jar/ for the basics.

Cheers
Zeroth




PostPosted: Fri Jul 25, 2008 9:58 pm   Post subject: Re: Java web start packaging?

Thanks Btiffin. That link will help a lot. Smile
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: