473,569 Members | 2,721 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Jar files execution failure

40 New Member
I create jar files like that:
Expand|Select|Wrap|Line Numbers
  1. jar -cvmf manifest.txt app1.jar *.class
I run them like that:
Expand|Select|Wrap|Line Numbers
  1. java -jar app1.jar
Ok so far. My program is up and running.

When I try to run the same jar files with double click ( in Win XP I associate them with java.exe) I get an error, Exception in thread main...no class found.

What am I doing wrong?

Thanks
stack
Sep 27 '07 #1
3 1987
Nepomuk
3,112 Recognized Expert Specialist
I create jar files like that:
Expand|Select|Wrap|Line Numbers
  1. jar -cvmf manifest.txt app1.jar *.class
I run them like that:
Expand|Select|Wrap|Line Numbers
  1. java -jar app1.jar
Ok so far. My program is up and running.

When I try to run the same jar files with double click ( in Win XP I associate them with java.exe) I get an error, Exception in thread main...no class found.

What am I doing wrong?

Thanks
stack
Probably Windows isn't adding the "-jar" argument and therefore it can't find any of your classes - especially not the class containing the main method.

To set it that way, open the place, where you associated JAR files with java.exe and click on "More" (or whatever the button may be called). If there's an Operation called "open", edit that, otherwise create a new one called "open". It should have the following value:
Expand|Select|Wrap|Line Numbers
  1. "C:\Program Files\Java\jre1.6.0_02\bin\java.exe" -jar "%1" %*
Of course, you'll have to change the Path according to where java.exe lies.

Greetings,
Nepomuk
Sep 27 '07 #2
stack
40 New Member
Probably Windows isn't adding the "-jar" argument and therefore it can't find any of your classes - especially not the class containing the main method.

To set it that way, open the place, where you associated JAR files with java.exe and click on "More" (or whatever the button may be called). If there's an Operation called "open", edit that, otherwise create a new one called "open". It should have the following value:
Expand|Select|Wrap|Line Numbers
  1. "C:\Program Files\Java\jre1.6.0_02\bin\java.exe" -jar "%1" %*
Of course, you'll have to change the Path according to where java.exe lies.

Greetings,
Nepomuk
I don't know if you can do that with XP and if you can, I don't know how it's done.
My only option when I associate files is to choose from a list of programs but I cannot set a path.
Do you know where I can set this path with win XP?

Thank you for you reply,
stack
Sep 27 '07 #3
stack
40 New Member
Ok, problem solved.

Thanks
Sep 27 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1821
by: August1 | last post by:
i'm having difficulties with the execution of a program, i believe due to something i am missing in the copy constructor implementation. When i create one object of the class and run the program with that object alone, there are no problems. however, when subsequently using the copy constructor for a second object and/or a third object created...
7
32870
by: Kristan | last post by:
Hi there, quick question, how would I retrieve a list of files in ANSI C in a purely platform independent way? Any pointers would be great! thanks Kristan
10
10975
by: Kristan | last post by:
Hi there, quick question, how would I retrieve a list of files in ANSI C in a purely platform independent way? Any pointers would be great! thanks Kristan
7
2460
by: Kristan | last post by:
Hi there, quick question, how would I retrieve a list of files in ANSI C in a purely platform independent way? Any pointers would be great! thanks Kristan
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8119
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.