• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

executable jar file problem

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have been trying to create jar files that can operate by double clicking.I have succeeded in this before, and things were working quite well, until I installed and then uninstalled CodeWarrior 7. Now my jar files will not open on the double click. I did this before just by associating my executable jars with the javaw.exe in the jre, however now I get a error message saying that it is unable to locate the main class.
I even went so far as to unistall and reinstall the sdk. Any suggestions?
 
Bartender
Posts: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, a couple of things to check:
1). Check your manifest file for you jars to make sure that you have a "Main-Class" attribute present.
2). run "jar -tf <youJarName.jar>" to make sure that your main class is present if the .jar file.
If both of these check out fine, paste the exact error message you are getting and we'll see where else the problem might be.
 
Gerald B. Cormier
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Both of these work out just fine. There is the Main Class attribute in the manifest file and I do get the contents of the jar file by running "jar -tf TestFile.jar".
When I try to run the program I get the Java Virtual Machine Launcher trowing up a warning box just saying "Could not find main class. Program will exit!"
How ever when I produced the ar file from the command prompt I gat the two lines saying
"ignoring entry META-INF/
ignoring entry META-INF/MANIFEST.MF"
Not sure if this is normal or not.
Thanks in advane for any suggestions
 
Joel McNary
Bartender
Posts: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've never seen it say "Ignoring entry ...."
1). When you run "jar -tf TestFile.jar", are the META-INF/ and META-INF/MANIFEST.MF present in your jar file?
2). Does your manifest file have a newline after the Main-Class attribute?
3). What command are you using to produce your jar files?
 
Gerald B. Cormier
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the MEAT-INF and MEATA-INF/MANIFEST.NMF are both present. There are no new lines after the Main-class: attribute.
I really don;t think there is a problem with how I am creating the jar files. I tried to run the jedit installer jar file and the JVM Launcher still gives the same error. The installer works fine at the computer I use at work. As do all my jar files I created previous to this.
The only difference between each machine is I have had CodeWarrior 7 wireless pro installed on the problem machine. This never happened untill that was installed. And unistalling it, even making sure ALL registry entries were deleted didn't help.
Thanks for your help Joel. This is a real head scratcher.
 
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your Registry Entry has been corrupted or is missing. You need to check for an entry
MyComputer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Applications\javaw.exe\shell\open\command
Make sure the value is something like
C:\Program Files\JavaSoft\JRE\1.3.1_06\bin\javaw.exe -jar %1
 
Gerald B. Cormier
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IT WORKS!!!
I looked in the registry and found lot's of references to codewarrior. As in the HKEY_CLASSES section. entries like .jar having a value of "CodeWarrior_JAR". So after alot of searching and deleting... then installing the jdk1.4.1_02 everything is back to normal.
The next time I try out a new IDE I am making a backup of my registry just before I install it. I can' believe how much of a mess my regitry was in, even after uninstalling it. I guess I'm just silly in thinking that if you uninstall a program, ALL the data concernng it should be uninstalled, evn in the registry. lesson learned.

Thanks to you two for helping me, I was over a month pulling my hair out searching for a solution on net to try and solve this.
 
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Gerald B. Cormier:
IT WORKS!!!
The next time I try out a new IDE I am making a backup of my registry just before I install it. I can' believe how much of a mess my regitry was in, even after uninstalling it. I guess I'm just silly in thinking that if you uninstall a program, ALL the data concernng it should be uninstalled, evn in the registry. lesson learned.


Couldn't agree more!!!
That's why I hate these installers and love app like tomcat - you just unzip it in a folder and it starts working!
- Manish
 
Right! We're on it! Let's get to work tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic