This JAR is driving me crazy! Dukes to come...

Hi all,
I can create an executable jar, both programmatically and from the command line and the internal directory structure comes out fine, just as expected. However, If I double click on it, I get the dreaded "Cannot find main class, program will exit" error.
I have checked and double checked my manifest and it seems fine too. This is what is created inside the jar:
Directory called "jai" containing class files
Directory called "META-INF" containing one file, "manifest.mf"
Manifest looks like this:
Manifest-Version: 1.0
Main-Class: jai.Run
including the empty line at the end. Run.class does exist inside jai. I have also tried changing the main class to jai/Run with the same result. I just have no more ideas on what could be wrong even after trawling through the many postings on this topic. Any suggestions would be reaaaallly appreciated. I am so desperate that I will definitely add Dukes to this topic when I next get some more, but at the moment I'm all out!
Thanks in advance!

buckman1:
you may be on to something. There IS a jar inside the jar. The purpose of the main class is to extract the files from the outside jar, and run this one. (Frustratingly, the jar inside executes perfectly when double clicked!). Can you expand on what I have to do in the manifes? However, I don't think that's my problem as the error message is "Can't find main class", so it leads me to believe that the main class doesn't even get a chance to run.
Here's the directory structure inside the jar:
/META-INF/MANIFEST.MF (on checking, this always gets changed to upper case even if you add it in lower case).
/jai/Run.class
/jai/ua.jar
/jai/data/installConfig.txt
and that's it - only small.
Below is the Run code (obviously untested as I can't get the jar to run!):
package jai;
import java.lang.Runtime;
import java.io.*;
import java.net.URL;
import java.util.*;
import java.util.jar.*;
import java.util.zip.*;
import java.security.*;
public class Run {
  public Run() {
  public static void main(String[] args) throws IOException {
    extract();
  private static URL getJar() {
    Class theClass = new Run().getClass();
    ProtectionDomain pDomain = theClass.getProtectionDomain();
    CodeSource codeSource = pDomain.getCodeSource();
    URL loc = null;
    try {
      loc = codeSource.getLocation();
    catch (Exception ex) {
      ex.printStackTrace();
    return loc;
  private static void extract() throws IOException {
    String strJarFileName = getJar().toString();
    JarFile theJar = new JarFile(strJarFileName);
    Enumeration enuJarEntries = theJar.entries();
    while (enuJarEntries.hasMoreElements()) {
      JarEntry jeFile = (JarEntry) enuJarEntries.nextElement();
      //strTempDir is the Dir where the files are to be unjarred
      File oneFile = new File(System.getProperty("java.io.tmpdir") + "/" +
                              "JAITEMP" + "/" + jeFile.toString());
      if (jeFile.isDirectory()) {
        oneFile.mkdir();
      else {
        CheckedInputStream cis = new CheckedInputStream
            (theJar.getInputStream(jeFile), new CRC32());
        FileWriter fw = new FileWriter(oneFile);
        BufferedWriter bw = new BufferedWriter(fw);
        for (int i = 0; i < jeFile.getSize(); i++) {
          bw.write(cis.read());
        bw.flush();
        bw.close();
        fw.close();
}

Similar Messages

  • This website is driving me crazy.   All I need to do is to contact a real body for help that is not listed.

    This website is driving me crazy.  All I need to do is to contact a real live body for help that is not listed.
    This shouldn't be that difficult.  GRRRRR

    Post DETAILS about the help you need here and someone may be able to help... some questions to get you started
    From the Premiere Elements Information FAQ http://forums.adobe.com/thread/1042180
    •You MUST use an account with Administrator Privileges to run Premiere Elements
    •(Doing Run as Administrator http://forums.adobe.com/thread/969395 [says Encore and also for "All" versions of Premiere] will sometimes fix "odd" errors)
    •What version of Premiere Elements? Include the minor version number (e.g., Premiere Elements 12 with the 12.0.1 update).
    •What operating system? This should include specific minor version numbers, like "Mac OSX v10.6.8"---not just "Mac"
    •Has this ever worked before?  If so, do you recall any changes you made to Premiere Elements, such as adding Plug-ins, brushes, etc.?  Did you make any changes to your system, such as updating hardware, printers or drivers; or installing/uninstalling any programs?
    •Have you installed any recent program or OS updates? (If not, you should. They fix a lot of problems.)
    •What kind(s) of image file(s)? When talking about camera raw files, include the model of camera.
    •If you are getting error message(s), what is the full text of the error message(s)?
    •What were you doing when the problem occurred?
    •What other software are you running?
    •Tell us about your computer hardware. How much RAM is installed?  How much free space is on your system (C:) drive?
    And some other questions...
    •What are you editing, and does your video have a red line over it BEFORE you do any work?
    •Which version of Quicktime do you have installed?

  • I have a ipod touch 2nd generation and using windows vista? Cant get the ipod touch to show in i tunes and or windows. I thought I had trie everything but cant figure this out. Driving me crazy

    Windows cant find the driver for my ipod touch 2nd generation. Can somebody help?

    See:
    iOS: Device not recognized in iTunes for Windows
    I would start with
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    or
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    Run this to help if it identifies the cause
    iTunes for Windows: Device Sync Tests
    Have you tried on another computer to help determine if you have a computer or iPod problem?

  • When I am trying to use or am using my apps here lately they are turning off, how can I fix this it I driving me crazy?

    I am really getting frustrated with my apps turning off. It happens several times a day. Does anyone have any ideas why it is happening an how to fix the problem?

    Hi Friend,
    This is happen with me as well. So I turn off my iPhone and wait for few minutes and turn it on again always solve the problem.
    Hope it will be helpful

  • This problem is driving me crazy!!! Help please!!

    Hi, I've a 20 inch iMac with a glossy wide screen, which I calibrate using Spyder3. I've also created my own printer profiles with Spyder3 printer.
    I have verify, using the ColorSync Utility, that all the icc profiles are correctly installed.
    My problem is that I'm getting always a color cast when printing using Aperture. When screen proofing, there is no color cast, however, as soon as I try to print and choose form the printing menu the ColorSync profile I want to use to print, then I can see on the preview screen that the pictures gets a yellow color cast, which also is printed.
    I've tried letting the printer to manage the colors, but then I get really dark pictures.
    Trying to compare what it's happening, I've also tried to print using Photoshop and there, when I set Photoshop to manage the colors and select the profile, either the one created by me or the one delivered with the printer, then I also can see on the preview window that the picture gets a yellow color cast.
    Here there is a difference with Aperture, because in Photoshop when I let the printer manage the colors, then I'm getting almost perfect prints and I don't see any color cast on the preview window.
    Could you please help me, I've being trying to solve this issue since I got Aperture 2.0 and I don't know what is the problem.
    when I'm selecting the printer profile provided by Apple (HP Photosmart for series C5100)I can see on the screen that the pictures turns awful with this yellow cast. The problem is that when I select a standard profile is even worst.
    Today checking the profiles with a programm I found on the internet I saw that each icc profile was repeated 3 times, therefore I don not know if there is a conflict. If there is a conflict, where should be the correct icc profile?

    even somebody sent an Email stating that instead on opening a how is your configuration thread they should talk about "null conversion"??
    Null conversion is when the source profile and the destination profile are the same profile. In this scenario, there is no conversion. You can try a null conversion, but the principle is that you should convert from the colour space of the ICC profile that defines the colours of your RGB colourants in Aperture to the ICC profile that defines the colours your printer configuration forms.
    There's a Knowledge Base article on the subject of setting up a colour managed printing configuration. The Knowledge Base article says you should make sure you have a good ICC profile for the printer configuration, as above. There's also the Color Management in Tiger overview (there was an overview of OS X 10.3 similar to the overview for OS X 10.4, but I'm not sure there is an overview for OS X 10.5).
    With regard to the Knowledge Base article, I'm sorry to say it has spelling errors and sentences I'm not sure make much sense. For instance -
    "Black Point Compensation is an adjustment the compensates for the difference between the way black images saturate on a computer display as opposed to the way black ink saturates on a print."
    Technically, you are supposed print with the printing table in your ICC profile, table 0 Perceptual. This table, if your profiling software is any good, gives you softclipping in shadows instead of linear clipping, among other things. It also gives you gamut mapping, and part of gamut mapping is shifting as well hue as saturation.
    You are supposed to proof with Relative Colorimetric, or calculate the media white point into the RC table to derive the Absolute Colorimetric table on the fly. Some people want to print with the Relative Colorimetric table as they hold that there may be less desaturation, although colours outside the destination gamut still have to be remapped - they can't just be left out / clipped.
    The problem with the Relative Colorimetric table is that if your source ICC colour space has a deeper L* than your destination ICC colour space, the difference in lightness levels is lineary clipped and not soft clipped. In other words, you can loose delicate shadow detail in hair, foilage or whatever. This does not happen with Perceptual which is built to manage that problem.
    Originally, Adobe had a low end colour management system that could only handle a relative colourimetric conversion with compensation of the black point to avoid clipping of shadow detail. This became Relative Colourimetric with Black Point Compensation in Photoshop 5, when it first appeared in Adobe interfaces.
    When you are matching from emissive softcopy to reflective hardcopy, you are supposed to be using Perceptual. If the Perceptual table is any good, it should correct for a bluish tint in your paper by compensating the graybalance towards yellow. If you get a yellow effect in a D50 viewing booth, then for whatever reason the Perceptual table isn't doing its job or you are using the wrong paper for the given profile.
    /hh
    Reference:
    http://support.apple.com/kb/TA38346
    http://images.apple.com/pro/pdf/ColorMgmtinTiger.pdf

  • This is seriously driving me crazy

    I am trying to download the Creative Cloud application or even just Photoshop which I urgently need for tomorrow. I have already posted that while using the online web download page, when I click on the download button all I receive is a blank page. The last piece of advice I was given was to use the chat option on one of the Adobe pages but that didn't connect either.
    Now when I try to follow any replies to that post all I get is a blank page when I click on any option on the "My Stuff" link. What is going on? Also, can someone please, please, please help me. This is really frustrating. All I want to do is download the CC stuff I am paying for.
    Sorry if this sounds nasty but I am getting desperate here.

    I have posted this problem on other forums where I did post the system and browser info. There are many similar forums that could cover this problem I wasn't sure which one to use and I said, I really needed it. Even though I was getting help, I desperately needed Photoshop, at least, to be working for Tuesday night. This issue is really keeping me back at work. I have had to stay at work late all this week which is having a knock on effect at home. I am really mad at Adobe. All I need is to download their programs from the download page. I am just in from work and will try the suggestions you made as soon as I can.
    I am using Windows 7 64 bit and tried both Firefox and Chrome browsers without success. Both browsers are working fine with every other site I use. Like I said I am sorry this sounds a bit nasty and short but I so needed the program to be installed.

  • Help Please (This KT3 is driving me crazy)

    Four weeks ago i got a KT3 Ultra 2 (MS-6380E) with RAID. I could never get it to boot up. It was stuck at "Initializing Hard Drive Controller". After a few days of reading threads here i get a new PSU (Future Power WIN-400PS) that what some people said it should have:
    +3.3v        +5v         +12v        -5v        -12v      +5VSB
      15A        30.0A       15.0A      0.6A       0.6A        2.0A  
    And the thing boot-up with no trouble. One week later i did something wrong trying to flash my bois and the board would not power up. I know the i need a new bois chip so i call MIS a the mailed me a new one. I put the new bios in and now the board is back to "Initializing Hard Drive Controller" with the same PSU that worked last time. I have tried many things to get this board to boot up. With and with-out hard drive, memory and even in and out the case. I have tried it with i AMD Duron 600 and 1200Mhz chip. What can and/or should i try to get this board to work right.  ;(

    OK, MSI said that they are sending me a new motherboard.  :D Here is where I need so info from you guru's out there. 1) What type of power supply are you using? 2) Tell me what you think of this PSU: http://www.systemcooling.com/modules.php?name=News&file=article&sid=216  and 3) How many watts do you think I need for the following items in my case. Any and all advice is very, very important.
    •   2 x 40GB ATA 133 Maxtor hard drives (Raid 0)
    •   2 x LG Goldstar 40x12x40 CD-RW   (Model GCE-8400B)
    •   LG Goldstar 16x DVD-Rom (Model DRD-8160B)
    •   2 x 512MB PC2700 DDRAM
    •   MSI Ti4200 128 AGP Video Card
    •   AMD 1800+ or 2200+
    •   Linksys 10/100 Nic
    •   A-Open 56k v.92 Fax/Model
    Thank you,
    Jixxi

  • HT3964 This mac is driving me crazy

    I bought a macbook pro 15-inch, mid 2009 2.8 GHz intel core 2 Duo, 4 gb 1067 MHz DDR3, NVIDIA Geforce 9400M 256MB Mac OS X Lion 10.7.5, After I did a reinstall of the os I have no camera and no wifi. Before the reinstall I had the message: Wi-Fi:no hardware installed
    I have a new macbook pro 13 and it works great, I love mac. I used to be Microsoft certified but I changed my major in school. I have twelve computers, mostly unbuntu and windows seven so I am fimiliar with terminal and programing. Is there a way I can fix the macbook 15 through terminal or should I consider changing the os to mountain lion instead of lion? Any advice will help, Thank you in advanced, G2.

    I have reset the SMC and that did not work. The weird thing is I got the wifi to come on but when the computer restarted it went off again and the computer is not even recognizing the hardware now. Just I thought I had the problem fixed it broke again, just my luck. One of my friends said this particular macbook pro has a problem running OS X lion and suggests I change it to run OS X Mountain Lion. Thoughts on the OS change? Also, are there "drivers" for Mac? I know that looks like a weird question but I am not familiar with Mac like I am PC.

  • I've added to ios6 to my new ipod touch with no problems. I'm trying to now restore the factory settings but the screen is frozen with an itunes sign and lead pointing towards it. The ipod won't even switch off. Can anyone help as it's driving me crazy

    I've added ios6 to my new ipod but tried then to restore the factory settings. It won't extract any settings and the itunes then tells me that the server cannot be reached or is unavailable. I've been trying all day. Now the ipod has a itunes sign and a computer lead pointing towards it on the screen and this is frozen. It won't switch off or do anything else. Any ideas as this is now driving me crazy.

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

  • Mail 2.1.3 on Tiger: mutiples of everything is driving me crazy!

    Hi, I recently had to reformat my hard drive and thus have been trying to reinstall all my email accounts (which I had backed up). I am using MAIL 2.1.3.
    I have several questions (this is driving me crazy!!):
    When I imported the archived files, it created new mailboxes but DID NOT reinstall my mail in it's corresponding email account file (i.e: i have an email account for incoming mail with "username", and then far below I have a mailbox (for EACH account, and I have about 7) which contains all my old mail. I can't seem to merge the two.
    When I recreated my useraccounts (most of which are gmail), I followed online instructions and created all my accounts using IMAP, since my first attempt using the POP version of these same accounts would NOT SEND OUT any of my Gmail mail. Now, for EACH ACCOUNT, not only do I have a "regular mailbox", I have the same "imported" from my old version, AND a third folder under "IMAP".... All this is REALLY driving me crazy!!
    All I want to achieve is what i had before : one version of each of my email accounts, including Gmail, that both recieve AND send mail. Nothing more.
    On the my other computer (leopard) Mail configures itself and everything works: it's bliss!!!
    Can anyone help me clear up this mess (also because as a result everything is SLOW!!)
    Infinite thanks,
    Nicaru

    Thanks BDAqua, Unfortunately I did not do a very good job explaining myself.
    I am not trying to sync two computers (Tiger/Leopard). The Leopard comment was just me venting that it was so much a better program than Tiger....
    No, what I want is simply to recreate my Mail Client the way it looked before: with one inbox per username, a single Sent/Draft/Outgoing mailbox and that's all!!
    Instead for each username I have "normal" Inboxes, PLUS imported folders (each with their own Inbox/Sent/Draft mailboxes) PLUS IMAP folders again with their own individual Inbox/Sent/Draft mailboxes). My homepage when I open Mail contains something like 21 folders, whereas I only want the 7 (one per username).
    This whole thing came about because when I tried to import my old mailboxes (pre-formatting my mac) they imported as separate folders whereas I wanted them to merge into their respective accounts.
    The other issue I had (originally) which led to this mess is that none of my Gmail accounts would SEND mail (receiving is Ok) so I followed the online IMAP instructions and this is where I got triplets....
    Gosh, I don't know how else to explain it... If it's still not clear perhaps I should just erase everything and start from scratch??
    Thanks again,
    Nicaru

  • Spinning beach ball, driving me crazy

    I have been running Safari fine in all my machines until last week. I am trying to remember what I put on the computer before the problem, Dragon diction was just updated and for some odd reason I was asked to update flash and did, but I was running the right version. Since then I dumped flash and reloaded it.
    Problem:
    No reason but all of a sudden when calling any random page I get a spinning beachball. Sometimes after ten to 20 seconds it recovers but in most case I have to do a force quit and start over. Have no issues with Firefox or Camino. But this problem is driving me crazy. Help
    Have a new Power Mac 2.66 with 4GB. Running 10.6.4 and running Safari 5.2
    Thanks

    HI...
    If you didn't repair permissions after updating Flash, that may help.
    Launch Disk Utility. (Applications/Utilities) Select MacintoshHD in the panel on the left, select the FirstAid tab. Click: Repair Disk Permissions. When it's finished from the Menu Bar, Quit Disk Utility and restart your Mac. If you see a long list of "messages" in the permissions window, it's ok. That can be ignored. As long as you see, "Permissions Repair Complete" when it's finished... you're done. Quit Disk Utility and restart your Mac.
    Carolyn

  • Please help me fix this problem it's driving me crazy. I have tried installing and reinstalling photoshop EXTENDED several time and each time i lunch it ask me for the serial number in which i entered it once entered nothing happens

    Please help me fix this problem it's driving me crazy. I have tried installing and reinstalling photoshop EXTENDED several time and each time i lunch it ask me for the serial number in which i entered it once entered nothing happens

    Hi Glenn,
    Kindly try out the steps mentioned in the link below and see if you are able to serialize your software.
    Sign in, activation, or connection errors | CS5.5 and later, Acrobat DC
    Try Solution 2: Clean up cached user login information.
    Please share the results after performing the steps.
    Thanks,
    Atul Saini

  • Every time I sync my Iphone 5c(with ios 8) to Itunes, it 1. deletes all of my purchased music 2. deletes all of my album artwork 3. replaces all of my deleted songs. please help! this is driving me crazy!

    Every time I sync my Iphone 5c(with ios 8) to Itunes, it 1. deletes all of my purchased music 2. deletes all of my album artwork 3. replaces all of my deleted songs. please help! this is driving me crazy! It syncs 100+ songs, when I only want to sync 1! I'm running Itunes 11.3.1.2

    After having experienced similar problems and having it back to work, I have a few suggestions:
    - Try to find out if the syncing stops at a particular track or song. That might - out of the blue - have gotten corrupted in one way or another. Since that song will not be on the iPod, iTunes will try over and over to put it on and crash in one way or another;
    - reformat the iPod as described in the iTunes 9 crash-thread. It takes time (at first it seems to do nothing, but that is because the green bar is moving with very small steps);
    HTH

  • I just got a MacBook Pro and when I was setting up I got this voice over thing to help me out...I now can't get rid of it and it is driving me crazy...can anyone help?

    I just got a MacBook Pro and when I was setting up I got this voice over thing to help me out...I now can't get rid of it and it is driving me crazy...can anyone help?

    System Preferences > Universal Access. Turn off Voice Over in the "Seeing" tab:

  • Every time I've tried to open my hotmail today, an H&R Block site pops up trying to get me to buy their tax prep software and I can't find a way around it. This is driving me crazy. Please help.

    Every time I've tried to open my hot mail today the page is usurped by H&R Block, trying to get me to buy their tax prep software and I don't see a way to close it out.

    No, it doesn't come up in any other browser. The interesting thing this morning was I had inadvertently doubleclicked my hotmail icon and two windows came up, one over the other. The first one had the H&R Block site that is driving me crazy, which I closed, but the second one had my dear old emails without the dreaded H&R Block takeover. I haven't been able to send a picture of the page, but it looks like an H&R Block web site and lists the various tax prep software and prices. You can navigate all around the site, too.

Maybe you are looking for

  • I "have" to buy a remote just to watch a DVD from my new iMac?

    I can't even play a DVD on my new computer? I tried to look up "Front Row" tutorial on Apple's site. Well, I get over 230 topics, none of which relate to the "Front Row Application". This is pretty upsetting if I have to buy extra equipment just to w

  • K8T Neo V - Radeon X800 GTO Issues

    Hi, I've just upgraded my PC to an MSI K8T Neo-V MB with an Athlon 3400 and am having issues when running it with my Radeon X800 GTO  :( Everything boots up ok, until the point Windows XP has loaded and goes to the login screen. At this point I get a

  • Check if username and password passed are valid?

    hi, i've been asked to create a shell script that accepts a username and password which i then need to check against the database.. but the script won't be running any sql commands.. it will run another script that also accepts a username and passwor

  • OWB scrambled display problem

    Hi all, I tried to search this problem within the forum without any luck. Every time I use my mouse scroll on the 'Project Explorer', it gives me scrambled lines. I'm using Vista Ultimate, ASUS EAH3450 graphics card, 2 monitors, Oracle 10.2.4.36 OWB

  • MTS file previews in Finder

    Hello - Does anybody know how to make the Finder show previews of MTS (video) files??