Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,981 members, 7,817,889 topics. Date: Saturday, 04 May 2024 at 10:07 PM

Another Challenge For Java Gurus - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Another Challenge For Java Gurus (1182 Views)

Programming Challenge For Beginners N20000 / Mini Web Application Coding Challenge For Programmers (2) (3) (4)

(1) (Reply) (Go Down)

Another Challenge For Java Gurus by chukxy: 7:19am On Aug 28, 2008
I have developed some applications in java. My challenge is to set this application on the desktop
so that by just clicking on the icon on the desktop, the application would run, instead of the usual
java classname on the command prompt to run the application. Your suggestions are welcomed. Thank you in advance.
Re: Another Challenge For Java Gurus by ade2kay(m): 9:16am On Aug 28, 2008
google up Jar2Exe.
It's a software for creating .exe from jar files
Re: Another Challenge For Java Gurus by javaprince(m): 1:17pm On Aug 28, 2008
ade2kay:

google up Jar2Exe.
It's a software for creating .exe from jar files
Well, thatz a way. But not the Java way. Haven't you heard of the jar tool? With the Jar tool you can compress and zip all ur class files and dependencies into a single Jar File and use a configuration file (Manifest.mf) to specify the Class with the Main method.

Just do this:

Example 1: to archive two class files into an archive called classes.jar:
jar cvf classes.jar Foo.class Bar.class
Example 2: use an existing manifest file 'mymanifest' and archive all the
files in the foo/ directory into 'classes.jar':
jar cvfm classes.jar mymanifest -C foo/ .

Let your manifest file be like this and remember to save as mymanifest.mf

Manifest-Version: 1.0
Main-Class: ClassName

And thatz all. Once you have a JaVa Virtual Machine, all u need to do his double click, ur program comes up.
Re: Another Challenge For Java Gurus by zerohaxor(m): 2:00pm On Aug 28, 2008
javaprince, Ur man saying HOLLa, (ZERO) (Ft), my mail exrollyy@yahoo.co.uk, B eazy bro.

Re: Another Challenge For Java Gurus by javalove(m): 5:55pm On Aug 28, 2008
u scared me a bit with ur subject sef, i tot u wanted us to use java to split the moon grin

@javaprince has give u a handy answer
Re: Another Challenge For Java Gurus by javarules(m): 8:11pm On Aug 28, 2008
Haba? are u living in the 18th century or what? a jar file is an executable file in fact the name na executable jar file, and dts since java 1.4.2 or so

Anyway the cool way I use it jnlp. Here is a sample jnlp script, u can figure it out for yourself. Just save the file as anything.jnlp dts all


<?xml version="1.0" encoding="utf-8"?>

<jnlp spec="1.0+"

      codebase="http://www.devdaily.com/downloads/"

      href="Rehoboth.jnlp">

  <information>

    <title>Rehoboth E-GOld Generator</title>

    <vendor>Teemy By Forex</vendor>

    <homepage href="index.html"/>

    <description>Whatever you want to use as a long, or very long description</description>

    <description kind="short">this description is shortwer</description>
    <!--I am hoping you have an ICON, specify the url of the image here,-->

    <icon href="logo.gif"/>

    <offline-allowed/>

  </information>

  <resources>

    <j2se version="1.3+"/>

    <jar href="Rehoboth.jar"/>

  </resources>

  <application-desc main-class="com.devdaily.oss.typeahead.TypeAheadTest"/>

</jnlp>



The cool thing about jnlp is dt ur users can click on a link in their browser and if they have java it will download your jar file and run it.

If the person saved the jnlp(Save Target as) then the jar file(files) only get downloaded once. subsequently, the jnlp file use the local cache version of the jar file.

Another cool thing is if the timestamp on the online version changes, the jnlp automatically downloads the new version wen the user clicks it.

1 Like

(1) (Reply)

What Is Wrong With Microsoft? (Compulsory Visual Studio Upgrades) / Matchfinding Algorithm / Where Can I Get "C# How To Program" Textbook

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 17
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.