Error when duble click on executable jar file

when duble click on jar file I get error message " Could not find main class . program will exit" , I am using jre 1.5_04,
when I runnig from command - java -jar ./myJar.jar --> works fine.
when I runnig from command - java -cp ./classes myUi --> works fine.
I get the error just when I try to execute the jar by duble click.
it some one knows what can be the problem??
Thanks
Nir

The message bar says " The following disk image couldn't be opened"... As for reason... "Not recognized"

Similar Messages

  • Error trying to run an executable Jar file

    Hi,
    I know a million people have asked this before. In the past 5 hours I have waded thru a dozen questions-answers-FAQs that were no help. So if anyone is willing to help a stupid person her is my problem:
    I developed a java program using the eclipse ide and it runs fine from within that ide.
    I packaged it into a Jar file, created a manifest file per the instructions.
    But when I double click on the jar file I get the following error from the Java Virtual Machine Loader;
    "Could not find main class. Program will exit."
    My Manifest file has the following text:
    Manifest-Version: 1.0
    Class-Path: swt.jar
    Main-Class: .graphicalUserInterface.AppStandAlone
    <blank line>
    the class AppStandAlone has the method "public static void main(String[] args) "
    it is in a package called "graphicalUserInterface".
    Any help anyone can give me would be greatly appreciated.

    Another 3 hours spent trying to run this java application in a Jar file.
    I identified that I did not have all class paths specified. So I tried to enter them in the "Class-Path:" line of the manifest file. But, according to the java tutorial, the syntax in a manifest file for classpaths is a space SEPARATING each path name. I have a space IN the path name and java is not understanding the paths correctly. For instance, I have a classpath c:\Progran Files\Java\etc... and java interprets this to be a classpath c:\Progran with Files\Java\etc as the program I want to run.
    I tried enclosing the paths in double quotes. Didn't work
    I tried enclosing the paths in single quotes. Didn't work
    I tried using a semicolon as a separator with double quotes. Didn't work
    I tried using a semicolon as a separator with single quotes. Didn't work
    I tried using a semicolon as a separator with no quotes. Didn't work
    I removed the "Class-Path:" line from the manifest and tried adding -cp param to the java command. Example:
    java -cp %classpath% -jar myapp.jar
    I tried all the variations above in the -cp param. None of them worked.
    The only thing that works is if I move executable jar file to the same directory as the required libraries. Then I specify a "Class-Path:" line with no spaces in the path names. Obviously this is not a permanent solution.
    If anyone else has the patience to help me I would really appreciate it.

  • "The attempted operation failed. An object could not be found" error when double clicking on an ics file

    Operation System: Windows 8 Pro
    System Type: 64-bit Operating System
    Office: MS Office Professional Plus 2013
    I am getting "The attempted operation failed. An object could not be found" error when I double click on an .ics file to an appointment to my calender. My outlook.com account's data file is set as default and this error only occurs if
    that is the default data file. I thought that maybe my profile is corrupted. So, I opened up a new profile with the below steps and only add my outlook.com account there:
    1-) Open up the Control Panel and go to Mail section
    2-) Click "Show Profiles"
    3-) Click "Add" and give a name to your profile.
    4-) Configure your outlook.com account (with Auto Account setup, not manual steps)
    5-) Finally, set that profile to be used always.
    Then, I opened up the Outlook 2013 and clicked on the .ics file to add that appointment but got the same error.
    Is this a known issue or specific to me?
    Thanks!

    yes, I have the same problem.
    The workaround of saving the ICS file and then importing it into the current calendar
    works, 
    but the ICS calendar
     displays in other section, NOT in the section of my old events.
    why  ??

  • ADF BC: Compiling error when refering to VO in jar file from VO in source

    I have a VO which I recieved from an another team in a JAR file. I have a VO in my project as well. I also have a view link in my project to join the 2 VO s together. When I try to compile using JDeveloper I get an error saying that "One or more attributes for one of the viewlink ends were not found" and the location of the VO in the jar file is given.
    If I take the contents of the JAR file and put it into the source directory and then compile, it goes through fine. I don't want to expand this jar file as this is not code I own, so what can I do to use the VO directly from the JAR file ?

    Hi,
    U have to import these statements,
    import com.sap.security.api.IUser;
    import com.sap.security.api.UMException;
    import com.sap.security.api.umap.IUserMappingData;
    import com.sap.security.api.umap.NoLogonDataAvailableException;
    Refer this thread,
    https://wiki.sdn.sap.com/wiki/display/EP/PointersforTroubleshootingPortalRuntime+Errors
    Code
    import com.sap.security.api.*;
    import com.sapportals.portal.prt.component.*;
    IUserFactory iuf;
    ISearchResult isr;
    IUser user
    String userid;
    iuf = UMFactory.getUserFactory();
    isr = iuf.getUniqueIDs();
    you will need to iterate the ISearchResult object but you can get IUser objects by
    userid = (String)isr.next();
    user = iuf.getUser(userid);
    Regards,
    Sunaina Reddy T

  • Executable JAR file and subdirectories, locale...

    Hi:
    I have created an executable jar file. In my program, I have to display an icon in which I stored in a subdirectory. This subdirectory is also archived into the jar file. However, as the application runs, it can't find the icon! I have to seperately create a subdirectory (with the same name and structure as the archived directory) for my program to display the icon properly! Does anybody know how I can use the archived subdirectory directly?
    Also, the executable jar file has a problem of using the proper locale... Does anyone know how to get around this?
    Thanx in advance for helping me out = )

    Thanx! It worked!
    Does anyone know the answer to my second problem, namely, using the correct locale to display characters? When I run the application on the unarchived class file it works fine. However, when I run the application double-clicking the executable jar file icon, the characters are displayed incorrectly, which I assume to be problem with the locale...

  • Executable Jar file doesn't show images

    Hello all,
    In my jar file, I have two references to images, which are instantiated as follows:
    Icon something = new ImageIcon("image.gif");
    However, when I compile an executable JAR file, these images don't show.
    I've included the image in the directory which is used for the jar source, and I can't think of any other reasons why it wouldn't work... Does anyone have any ideas?
    Thanks
    Gemma

    First you need to create an URL to the image inside your jar
    String insideJarPath = "/mypackage/images/myImage.jpg"; // starts with a /
    Url myImageURL = getClass().getResource(insideJarPath);
    Then use that to create your ImageIcon:
    ImageIcon myIcon = new ImageIcon(myImageURL);
    See API of Class.getResource()
    It will tell you that you can work absolute from inside the jar by starting with a "/" for the insideJarPath.
    Or you can work relative from the package directory of the class instance calling getClass() by not starting with "/".

  • NoClassDefFoundError when attempting to execute jar file

    I've created a jar file for an application that uses a 3d party jar file -comm.jar
    I jarred this jar into my new jar and I get the following error when I attempt to execute the jar: "Exception in thread "main" java.lang.NoClassDefFoundError: ColorScan"
    where ColorScan is the class containing main() (as indicated in MF file)
    I believe this is a classpath problem, however, should this problem exist if the classpath includes the location of ColorScan and the 3d party jar file (comm.jar)???
    I'm running on Windows 2000
    thanks

    PROBLEM RESOLVED:
    To include an existing jar file in a newly created jar file FIRST extract the contents of the existing jar file
    use the command:
    jar -xvf comm.jar
    where comm.jar is the name of the jar file you wish to extract from. This operation may create subdirectories off of the directory where the jar file to be extracted exists (depends on jar file and what's in it)
    eg.
    myJarDirectory/javax/comm/*.class
    myJarDirectory/com/sun/comm/*.class
    create a Manifest.MF file in the directory where you want to create a new jar file (make sure the extracted .class files from the existing jar file, or the subdirectories that contain them, are located in this directory also).
    the manifest file looks like this (watch case!)
    Manifest-Version: 1.0
    Main-Class: MyMainClass
    Created-by: Joe Developer
    where MyMainClass is the name of the class file that contains your main()
    Make sure all of your class files (from your program and the original jar file) are located in the same directory (with the Manifest.MF file)
    Run the following command to create a new jar file
    jar -cvfm cs.jar Manifest.MF *.class javax com
    where javax and com are the base subdirectories extracted from the original jar file
    and cs.jar is the name of your new jar file.
    Once this jar file is created you can just click on the icon and run the app from anywhere
    that's all

  • Class not found error while executing jar file

    I have written a java code in which i am connecting to database....when i run the class file using......java class_filename it works........
    but when i run the jar file using .......java -jar jar_name ...yi gives me the error as 'Class not found'......
    can anybody help me please......
    Thanks and Regards,
    Siddhesh

    that class is part of jar file.....in classpath i have included zip files for jdbc ...to get databse connection.....and the jar being executed ................still it gives the error ClassDefnotfound which i think is due to database connection problem.....the exception is raised while.....
    Class.ForName("Driver_name").newInstance();/ This driver is present in zip files that i have added in classpath....
    above statement doesn,t giv error while i execute the class file............but exception while executing jar file only..
    Thnaks and regards,
    siddhesh

  • Excel is throwing error when it click print : 'No printers are installed. To install a printer click the File tab, and then click Print. Click No Printers Installed, and then click Add Printer. Follow the instructions in the Add Printer dialog box'

    Excel is throwing error when it click print : 'No printers are installed. To install a printer click the File tab, and then click Print. Click No Printers Installed, and then click Add Printer. Follow the instructions in the Add Printer dialog box'
    Word, and powerpoint application are working fine.  
    Environment :  Windows 7 64-bit, MS Office 2013 64-bit
    Steps to recreate
    (i)  Create new user account and add to any group ( do not log on using this
     account)
      (ii)  runas /user:<new user account>  <fullpath>\excel.exe
       it will ask password so enter on command prompt
    (iii)  open any excel document  and click File->Print
      (iv)  verify result  (it is failing) it pop ups below error
     Error:`Microsoft Excel
     No printers are installed. To install a printer click the File tab, and then click
     Print. Click No Printers Installed, and then click Add Printer. Follow the
     instructions in the Add Printer dialog box.                                                                                                               

    Sorry for late reply i was not at work
    I have a default set excel is still throwing error. Interestingly winword , powerpoint and publisher are working fine. I am able to print from all office applications except Excel.
     Probably excel behaves differently from other office applications.
     Probably it is a bug in excel
    Workaround : Log on to a system once using newly created account then runas excel using this account then print works fine.
    It means something in user profile should be configure to run excel print operation. Could you please somebody help what I need to configure in user profile that makes print operation success?

  • I am getting system tray icon when i execute jar file.

    Hi.,
    I am not getting system tray icon when i execute jar file. But a process is created and its running at background... When i execute the same program in net beans, i got system tray icon as well. why i didn't get system tray icon outside the net beans.? Can anyone help me on this..?????

    Karthik_Java wrote:
    Hi.,
    I am not getting system tray icon when i execute jar file. But a process is created and its running at background... When i execute the same program in net beans, i got system tray icon as well. why i didn't get system tray icon outside the net beans.? Can anyone help me on this..?????What version of the JRE is set as the default on your machine, as far as I'm aware the ability to crap up the notification area was only added in JSE6.

  • Deploying Java Desktop App using executable JAR files

    Hi there.
    Today I am very optimistic about java. I am a beginner, and I had tried (in my few free time) to understand how to deploy java desktop apps.
    I am using the lattest NetBeans IDE to do the programming and it is very very fast and optimized.
    Going to the point, I tried some time ago to deploy an application (made with this IDE) using JAR files, but even though the application run well on my IDE, when I packed it, it rised an error saying that
    java.lang.NoClassDefFoundError: org/netbeans/lib/awtextra/AbsoluteLayout
    I was using an absolute layout on my JFrame forms and this AbsoluteLayout is provided by netbeans and not by the normal SDK.
    I then looked for the absolute layout class and found a jar file in the following path:
    C:\netbeans\modules\ext\AbsoluteLayout.jar
    So I mounted the Jar file in my File Systems and then added the contents of the file to myApp.Jar file.
    I used the automated Jar Recipe Packaging feature of netbeans, that is why I needed to mount the AbsoluteLayout.jar file into my file systems.
    Now it runs fine by just right clicking the MyApp.jar file from Windows Explorer.
    In a next reply to this topic I will include some sample code so that anybody requiring to do such implementation can take this for help.
    Regards!
    JN

    Well,
    I will take some time here to show the basic source code and procedure to create a desktop application, pack it up in a Jar file for deployment, add other classes or jars to the deployment jar file and finally open the jar file as an executable. This applies for either windows and linux environments.
    Take in count i am using Netbeans IDE 3.x (3.5)
    First I open the IDE and create a new project called MyDesktopApp. This is done by going to the menu Project / Project Manager. Then click on the New button and specify the project name and click on OK.
    At this point, the Filesystems tab in the project explorer is empty. So I mount a directory to store myDesktopApp in it. I selected c:\MyDesktopApp but you can select any name you want.
    To mount the directory you follow these steps:
    1. Right-click on File Systems
    2. From the contextual menu select Mount > Local Directory
    3. In the filechooser window, you just browse it and SELECT the directory to mount. Be aware that you can even create the directory on this window. Do not enter (double-click) into the directory you want to mount, just select it and click on finish...
    4.Then the directory entry appears under the filesystems node of the project explorer.
    Now you have to create your application. You can either create a package (special configured and tracked directory) or you can create the clases directly inside the directory. For tidy project, I will create the package.
    To create the package follow these instructions:
    1. Right-click on the mounted directory and from the contextual menu select New > Java Package
    2. In the New Wizard - Java Package window, type the package name and click on finish. I use the "MyDesktopApp" as package name.
    OK. Now the package is created under the mounted directory. Now we have to create the Main Class. In this case I will use a JFRAME as the main class but you can create any class you want.
    To create the JFRAME as main class follow these steps:
    1. Right click on the java package you just created and select New>JFRAME from the contextual menu. If you do not see the JFRAME option on the NEW sub menu you will have to select the All Templates option. I explain the All Templates option now on, it will be easier to use the JFRAME if available. Once you use JFRAME with the all templates then the JFRAME will show up in further NEW usage.
    2. So finally we used the All Templates, and you select the Java GUI Forms > JFRAME form option and click on NEXT.
    3. Give it a name. (I used MyDesktopAppFrm) and click on finish. Be aware you can set advanced options by clicking on next. But for the purposes of this topic we will use default options so click on FINISH
    4. A new JFRAME form appears inside your package. Right click on the form and select Set layout > Absolute Layout.
    5. Add some controls and code. I added a label and a button. And coded the ActionPerformed event of the button to say hello! on the label. this is up to you. The code just looks as follows:
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    // Add your handling code here:
    jLabel1.setText("Hello folks!");
    6. Compile and execute the form.
    Let's say this is our Desktop Application. Now We will pack it in a Jar in two steps...
    A. Create a JAR file (Recipe)
    1. Right-click on your package and select New > All Tempaltes (Long Route) You can also select New > JAR Recipe if available.
    2. On the New Wizard Window, choose the JAR ARchives > JAR Recipe template and click on NEXT
    3. I used MyDesktopApp as the file name and Defaults and then click on Next.
    4. Specify the JAR Contents. Select the Package (not the mounted folder) from the mounted file system and click on add and then click on NEXT twice...
    5. On the JAR Manifest window, click on GENERATE
    6. Edit the manifest in the window to add the following code:
    Main-Class: MyDesktopApp.MyDesktopAppFrm
    7. Ensure the Main-Class definition is the same as your java package and JFRAME name. Click on FINISH
    8. At this point we have a jar file in your project directory but this file wont run because it is missing some Netbeans clases that we will add in the next set of steps... Just to check, compile the file (right click on the JAR file and compile) and try to execute. It must compile but must not execute.(well if it executes you are done. It may execute if you did not set the lay out of the form as AbsoluteLayout)
    B. Add the AbsoluteLayOut to the JAR
    1. Right click on File Systems and select Mount > Archive Files
    2. Look for your netbeans installation folder and select the following file:
    .../netbeans/modules/ext/AbsoluteLayout.jar
    3. Click on finish
    4. Now the JAR File is mounted in the file systems.
    5. Right-click on your MyDesktopApp.JAR file and select properties.
    6. Look for the contents property click once on it and then on its elipsis button [...]
    7. From the FileSystems box in the Contents window, select the AbsoluteLayOut file and click on Add
    8. Then the system asks you if you are sure. Of course you are so click OK. (If not sure, just read the message text and click OK...:-))
    9. Click on OK
    10. Compile your JAR Recipe (right click on it and Compile)
    11. Now you must be able to run the file by right clicking it and EXECUTE.
    12. Also you must be able to run the file by double clicking the file from a Windows Explorer. You may receive a message asking to select the program to run the file with. You must browse and select the Javaw.exe file in the bin directory of your Java RUn Time installation. This is typically located at C:\j2sdk1.4.0_01\jre\bin or something like that. Use the File-Search feature of window to locate the JAVAW.exe file if needed.
    I hope this long explanation helps somebody to deploy Java Desktop applications. Please reply the message if it helps you just to know it was useful.
    Thanks for your time....
    JN

  • Executing jar files

    Hey
    I v made a jar file and m able to execute it through the command prompt by using the command " java -jar myapp.jar ". But when I double-click the jar file, m geeting a JVM error - Could not find the main class. I hv checked the Manifest.mf file, it seems alright. Can somebody plzzzzzz help me sort this out. M really stuck.

    johny2009 wrote:
    Hey
    I v made a jar file and m able to execute it through the command prompt by using the command " java -jar myapp.jar ". But when I double-click the jar file, m geeting a JVM error - Could not find the main class. I hv checked the Manifest.mf file, it seems alright. Can somebody plzzzzzz help me sort this out. M really stuck.I would say that if it works from the command line but not when double clicking, then your Windows file association for .jar files is not correct. You set that by opening a Windows folder view, finding and selecting a menu with folder options, File Types tab, select JAR, click on Advanced and edit the open action. On my Windows 2000 PC, the "Application to form action" is
    "C:\Program Files\Java\jre1.6.0_02\bin\javaw.exe" -jar "%1" %*

  • [b]Simple Deploy problem- making an Executable JAR File ...PLEASE HELP [/b]

    Hi all,
    I Trying to deploy a simple J2SE app by making an Executable JAR File, however I don'r understand how to add a valid value to the Main Class field.
    I followed the following description within Jdev, after creating a Deployment Profile:
    Deploying an Executable JAR File
    You can make your simple archive or J2EE Client Module into an executable JAR file that you can launch with the java command.
    To deploy an executable JAR file:
    1) Select and right-click the simple archive or client icon in the Navigator to display the context menu.
    2) Choose Properties.
    3) Click JAR Options in the tree.
    4) Select Include Manifest File (META-INF/MANIFEST.MF).
    5) In the Main Class field, enter the fully qualified name of the application class that is to be invoked.
    7) Click OK.
    8) Launch the executable JAR file from the command line:
    java -jar myapp.jar
    where myapp represents your JAR file name.
    Like I said it's in 5) I'm doing something worng
    My deploy-file (PlotPrint.deploy) looks the following:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <client-deployment xmlns="http://xmlns.oracle.com/jdeveloper/903/deploy/j2ee-client-jar" nselem="client-deployment" class="oracle.jdeveloper.deploy.jar.ClientProfile">
    <archiveOptions>
    <additionalManifests/>
    <compressed>false</compressed>
    <hasManifest>true</hasManifest>
    <mainClass>PlotPrintClient</mainClass>
    </archiveOptions>
    <archiveTargetPlatform/>
    <cdaSettings>
    <additionalArchives/>
    <afterFilters/>
    <beforeFilters/>
    <duringFilters/>
    <selectedArchives>
    <archives>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jdbc/lib/classes12.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jdbc/lib/nls_charset12.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jdev/lib/jdev-rt.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/soap/lib/soap.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/lib/xmlparserv2.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jlib/javax-ssl-1_2.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/jlib/jssl-1_2.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/j2ee/home/lib/activation.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/j2ee/home/lib/mail.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/j2ee/home/lib/http_client.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/webservices/lib/wsdl.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/lib/xmlparserv2.jar!/"/>
    <Item protocol="jar" path="file:/C:/Oracle9i_Jdev/jdevbin/lib/xmlcomp.jar!/"/>
    </archives>
    <selectionMode>0</selectionMode>
    </selectedArchives>
    </cdaSettings>
    <defaultConnection class="java.lang.String"/>
    <deployClientMaxHeapSize/>
    <earURL path="deploy/PlotPrint.ear"/>
    <enterpriseAppName/>
    <jarURL path="deploy/PlotPrint.jar"/>
    <profileDeps/>
    <properties/>
    <selectedProjectFiles>
    <autoInclude>true</autoInclude>
    <deploySourceAs>0</deploySourceAs>
    <files class="[Ljava.net.URL;"/>
    <selectionFilters/>
    </selectedProjectFiles>
    </client-deployment>
    I using Oracle9i Jdev, but have also tried it un the new Jdev 10g version, but the same problem everytime:
    Error message: Could not find the main class: program will exit.
    Please help I really need this to work
    Message was edited by:
    MHCI
    Message was edited by:
    MHCI

    Yes that was the problem so I have changed the element mainClass to
    <mainClass>xxPlotPrint.MHCI.PlotPrintClient</mainClass>
    But now another probem has occured, since I get the following error when run the jar-file (When I run the app from within Jdev there are no warnings or errors).
    ----Batch-file-----
    @echo off
    java -jar PlotPrint.jar
    echo Test Plot and Print Batch-file!
    pause
    ---- out to cmd ----
    Exception in thread "Thread-0" java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl
    at xxPlotPrint.MHCI.NNE35_worker.run(NNE35_worker.java:42)
    at java.lang.Thread.run(Unknown Source)
    Exception in thread "Thread-2" java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl
    at xxPlotPrint.MHCI.OCEJobDB_worker.run(OCEJobDB_worker.java:41)
    at java.lang.Thread.run(Unknown Source)
    Exception in thread "Thread-1" java.lang.ClassCastException: com.sun.org.apache.xerces.internal.dom.DeferredDocumentImpl
    at xxPlotPrint.MHCI.NNE27_worker.run(NNE27_worker.java:42)
    at java.lang.Thread.run(Unknown Source)
    It's the same problem in all three exceptions (the exactly the same code), however I was a bit to quick this is the line (the line before I process the xml doc :-)
    import org.w3c.dom.Element;
    responseData = new Vector();
    responseData = test_NNE35_SOAP.getXSDdoc();
    Element elements = ( (org.w3c.dom.Element)responseData.elementAt(0) ); (line 42)
    Please help I don't understad why I receive this exception, since I included the xmlparserv2.jar file, and don't even have a workaround :-(

  • Executable JAR file: Could not find the main class.

    Hello,
    I have a problem with making an executable JAR file.
    I have written a JAVA program that consists of five different classes of which User.java is the main class and I have saved a text document with Main-Class: User and a blank line after that.
    If I try:
    jar cmf MainClass.txt User.jar User.class Beheerder.class Operator.class Manager.class MaakVisueelSchema.class
    it makes a executable jar file which actually works! :)
    But when the Operator class trys to open the MaakVisueelSchema class the screen stays blank.
    I can run MaakVisueelSchema with java MaakVisueelSchema.
    So I tried to make an executable JAR that consists only of MaakVisueelSchema, the same way as I did for User:
    Main-Class: MaakVisueelSchema
    jar cmf MainClass.txt MaakVisueelSchema.jar MaakVisueelSchema.class
    Then I get the error message:
    Could not find the main class. Program will exit.
    from the Java Virtual Machine Launcher.
    The big difference between MaakVisueelSchema and the other classes is that MaakVisueelSchema contains a PaintComponent method and an ComponentListener. Is it possible that one of those creates the error?
    Can anyone help me with this problem?
    Thanks in advance!
    Bye!

    Yes,
    I tried:
    jar xvf MaakVisueelSchema.jar
    and it returns:
    META-INF/
    META-INF/MANIFEST.MF
    MaakVisueelSchema.classN/G. You need to manually create a manifest file in a text editor, have it point to your main class, and enter it in your jar command as an argument.

  • Associating executable Jar files w/ appropriate program

    Hi, I'm kinda new to java but this question is more OS related I think. I made a GUI program that reads / writes files and does some other stuff, I compiled it, then made it into an Executable JAR file. I put the file on my dektop w/ the required resource file (contains the read files) and then I double-click it and lo and behold Win-Ace(R) popps up. I right-clicked on the executable jar file, associated it with JAVAW, double-clicked again and it worked. So i guess my question is, is there a way that it will automatically associate itself with the right program so when I give this program to other people, they won't have to associate it the same way?
    Anyhelp would be greatly appriciated!

    No, becourse even if java could do that it would make sence becourse to run the jar it must be associated with javaw.
    But you could try to create a .reg file (registry file) that associate jar with javaw, when somebody runs the reg file it associate jar with javaw.
    But I think you should make different reg files for different windows versions (not sure about that).
    I don't have experience with how to write reg files but you just google.
    But I should try it out on your own windows, you could install windows on another partion and try it out on that one (first make a image with norton gost or something so if something goes wrong you can fastly get back to the old state).
    But you can also export your registry to a file so you can put the old registry back if somethings goes wrong.
    Use these tips on you own risk!!!

Maybe you are looking for