loose ends in java

I've programmed in java for a few years now, and one thing still remains a mystery.

How do I make a launch icon for my program so i can run it like any other application without having to go through the console or an IDE?

[235 byte] By [JFrustrationa] at [2007-11-27 10:57:00]
# 1

Make an executable jar file containing all the classes you need and ensure the system you are running it on has the required level of jre installed.

c0demonk3ya at 2007-7-29 12:06:19 > top of Java-index,Java Essentials,Java Programming...
# 2

Look into executable jars.

Or even AOT compiling.

dwga at 2007-7-29 12:06:19 > top of Java-index,Java Essentials,Java Programming...
# 3

Or Webstart wich would even provide a desktop icon. "Few years"?

CeciNEstPasUnProgrammeura at 2007-7-29 12:06:19 > top of Java-index,Java Essentials,Java Programming...
# 4

> "Few years"?

I must say I sniggered a little when I read this question lol

c0demonk3ya at 2007-7-29 12:06:19 > top of Java-index,Java Essentials,Java Programming...
# 5

> Or Webstart wich would even provide a desktop icon.

> "Few years"?

That caused me to raise an eyebrow as well (and as anyone who knows me will testify, that type of exercise is unheard of ;) )

macrules2a at 2007-7-29 12:06:19 > top of Java-index,Java Essentials,Java Programming...
# 6

is that a double chin emoticon?

JFrustrationa at 2007-7-29 12:06:19 > top of Java-index,Java Essentials,Java Programming...
# 7

if it makes my case any better im in college

JFrustrationa at 2007-7-29 12:06:19 > top of Java-index,Java Essentials,Java Programming...
# 8

> is that a double chin emoticon?

No... it was the closing parenthesis of an enclosed sentence

c0demonk3ya at 2007-7-29 12:06:19 > top of Java-index,Java Essentials,Java Programming...
# 9

> if it makes my case any better im in college

no... it doesn't :P

We're bad hehe

c0demonk3ya at 2007-7-29 12:06:19 > top of Java-index,Java Essentials,Java Programming...
# 10

> if it makes my case any better im in college

What case?

georgemca at 2007-7-29 12:06:19 > top of Java-index,Java Essentials,Java Programming...
# 11

the case that I'm in college and haven't ever had to distribute a program, when i try to jar my files and then run the jar, I get a "Failed to load main class manifest attribute form"

JFrustrationa at 2007-7-29 12:06:19 > top of Java-index,Java Essentials,Java Programming...
# 12

> the case that I'm in college and haven't ever had to

> distribute a program, when i try to jar my files and

> then run the jar, I get a "Failed to load main class

> manifest attribute form"

You need to have a manifext.txt file which points the jar to the main executable class.

The file should contain somehting that looks a little like this:

Manifest-Version: 1.0

Main-Class: com.myclass.classes.random.etc.blah.foo

c0demonk3ya at 2007-7-29 12:06:19 > top of Java-index,Java Essentials,Java Programming...
# 13

> the case that I'm in college and haven't ever had to

> distribute a program, when i try to jar my files and

> then run the jar, I get a "Failed to load main class

> manifest attribute form"

Well, thats a reasonable enough case I guess. But I'd be getting used to deploying apps outside of your IDE, to be honest. Almost every CV I see from graduates makes some claim to "full product lifecycle" but they've got no idea what that actually means. Deploying something standalone is a step in the right direction, though

georgemca at 2007-7-29 12:06:19 > top of Java-index,Java Essentials,Java Programming...
# 14

Create a link to javaw.exe, then edit it's properties to add the command line arguments to the java command and set the working directory.

This is more flexible than double clicking on an executable jar, because it allows you to add command line switches for extra memory or whatever.

malcolmmca at 2007-7-29 12:06:19 > top of Java-index,Java Essentials,Java Programming...