Seeking Advice

R

Rahul Sharma

I am new to java though I do have the basic knowledge.
How should I apporach.

I have one question too.

I am working on the client server application using RMI concept
developed in java. When I tried to make a jar file
of my application ,though the jar file was made but double clicking it
on the windows platform
did not executed my application. Told me could not find main class
though I had specified the main class the text file and used in
developing the jar file.
What could be the problem?

Also send me good
links so that I can study java in depth.
 
A

Andrew Thompson

Rahul said:
I am new to java though I do have the basic knowledge.
How should I apporach.

I have one question too.

Just one? ( famous last words ;)
I am working on the client server application using RMI concept
developed in java. When I tried to make a jar file
of my application ,though the jar file was made but double clicking it
on the windows platform
did not executed my application. Told me could not find main class

The exact and specific message being what?
(please quote error messages word for word -
copy/paste is best)
though I had specified the main class the text file and used in
developing the jar file.
What could be the problem?

Lack of a blank line at the end of the manifest file
(+ a score of other things)

Andrew T.
 
A

Andrew Thompson

Rahul Sharma wrote:

Sub: Seeking Advice

Oh, before I forget. The reason I repsonded to your
post originally was to point out that 'Seeking Advice'
is a poor title for a post.

People start threads on these groups for a number
of basic reasons. They might be ..
- Seeking advice
- Starting a discussion (which is often a troll, or an advocacy
matter)
- Promoting a product/project or job they have.

The vast majority are the first category, so it is best for
posts that are 'Seeking Advice' to be more specific
what they want advice on - to attract the attention of the
people who can answer the question.

In this case, a Subject line of 'Jar - main class not found'
might be good.

Andrew T.
 
R

Rahul Sharma

Thanks for your response.

Andrew Thompson


Now please disscuss how can i solve this problem.


Waiting for your response.
 
A

Andrew Thompson

Rahul said:
Thanks for your response.

You are welcome.
Now please disscuss how can i solve this problem.

I did that on my first post. There was a question, as
well as one possible reason your Jar does not work
as you expect.
Waiting for your response.

(my advice) Be patient, read replies carefully, and
answer whatever questions are asked.

Andrew T.
 
M

Michael Rauscher

Rahul said:
the exact error msg is

could not find main class program will exit

Make sure that there's a Main-Class entry in the JAR file's manifest.
Also ensure that this entry contains a fully qualified class name and
that the appropriate class file exists within the jar.

Bye
Michael
 
D

danharrisandrews

Hi Rahul,

I try to solve all my problems by creating an ant
(ant.apache.org/manual/index.html) build file. I always do a full build
by cleaning up the old classes directory and then compile everything
fresh. One of my ant targets is mainly a jar task as shown below. The
ant jar task will ensure your manifest works. Having a consistent build
script that comunicates how the build is to be done each and every time
is a great thing to do and is well worth the time.

<jar destfile="${jar.dir}/myjar.jar" basedir="./classes">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="my.path.MyMainApp" />
<attribute name="Class-Path" value="." />
</manifest>
</jar>

Cheers,

Dan Andrews

- - - - - - - - - - - - - - - - - - - - - - - -
Ansir Development Limited www.ansir.ca
- - - - - - - - - - - - - - - - - - - - - - - -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top