Exe-jar file

Good day, could someone please help with a little problem I have encountered,
I have built and a swing application that connects to MySQL database using Netbeans IDE, The problem I am experiencing goes like this. I have a login in window of which if a username and password match the username and password on the database then my login in frame is disposed off, then the main application frame appears, the strange thing is when I compile and run it from the IDE (Netbeans) it works fine, but as soon as I try run it from a jar file or make and exe using exej the main application frame does not appear after the login is successful.
Can someone please cast a light on this matter?
Thank you.

This is the error i get from exej
java.lang.NoClassDefFoundError: org/jdesktop/layout/GroupLayout$Group
     at java.lang.Class.getDeclaredMethods0(Native Method)
     at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
     at java.lang.Class.getDeclaredMethod(Unknown Source)
     at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
     at com.exe4j.runtime.WinLauncher.main(Unknown Source)

Similar Messages

  • How to run exe (jar) file in java?

    hello,
    i can retrieve jar file but can't run from outside of JBuilder ..why?
    can u help me, pls?
    nway nge

    Multipost.

  • How can i run a jar file as EXE on mouse click..

    *{color:#0000ff}how can i run a jar file as EXE on mouse click..is it possible in any way?????????{color}*

    amrit_j2ee wrote:
    *{color:#0000ff}how can i run a jar file as EXE on mouse click..is it possible in any way?????????{color}*Do you mean converting it from a jar file to an EXE file or do you mean that you would like to run the application by just double clicking it?
    If it's the latter then you need to make the jar file including a manifest.
    The manifest can be just a txt file with its content to be something like this:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.7.1
    Created-By: Somebody
    Main-Class: NameOfTheMainClass
    Class-Path:
    X-COMMENT: Main-Class will be added automatically by buildTo make the jar file including the manifest, use something like this in your command prompt (of course you must have compiled your java file(s) first):
    jar cfm test.jar MANIFEST.txt NameOfTheMainClass.classAfter that you'd be able to run your application just by double clicking it.
    If you're a NetBeans user, you can build your standalone application by right-clicking your project and then going to properties => run => and choosing a Main class. After that right click on that project and "Clean and Build", locate the jar file in the "dist" folder and double click it =]
    Hope it helps,
    LD

  • JAR Files for Distribution; Analogous to EXE?

    Hi everyone,
    I understand what JAR files are from the reading I've done, but I wonder, if I want to share my built program with others is JAR the only way to go, or the most common way? If not, what is?
    Can the use of JAR files be said to be analogous to the EXE type in Windows?
    Thanks!

    Based on my experience, the jar file is the only way to go. I have downloaded and used numerous jar files from other people; I have never ever used one of those EXE wrappers that people seem to be so fixated on. So yes, it's certainly the most common way of distributing Java software.

  • Running exe contained in jar file

    Hello,
    I have written a java interface where an external executable is being called from one of the classes. I'm using Jgrasp as development environment.
    Everything works fine if I run the java program from within Jgrasp: the interface opens up fine and it can run the external program when the button which is supposed to start it is clicked on.
    I have then generated a JAR file containing all the classes etc and also the external executable.
    When I execute the Jar file, the interface opens up ok and everything works fine within it, but it cannot run the external executable any more.
    Is it possible to run an exe file contained in the jar file itself?
    I would like to distribute a single jar file containing all the files needed by the application.
    Thanks

    An EXE can only be executed from Java if it resides somewhere in the file system.
    This is obviously the case before you JAR the whole thing, but not after.
    Your code will need to extract the EXE by using Class.getResourceAsStream() and
    copy it to a temporary location in the file system before executing it.

  • Include and call an .exe file inside my jar file

    Hi.
    I want to include an exe file and call it inside my jar file. this is the code.
    InputStream is = getClass().getResourceAsStream("/native/my.exe");
              int[] line = new int[is.available()];
              File myFile = File.createTempFile("my","exe");
              myFile.deleteOnExit();
              myFile.setExecutable(true);
              FileOutputStream out = new FileOutputStream(myFile.getAbsolutePath());
              int i = 0;
              int c;
              while((c=is.read()) != -1){
                   line=c;
                   i++;
              is.close();
              for(int j= 0;j<line.length;j++)
                   out.write(line[j]);
              out.close();
    So i store it in my temp folder. Than i run
    String myFileLocation = myFile.getAbsolutePath();
    p = rt.exec(myFileLocation);
    Everything goes fine, but the behaviour of the .exe file is not the same. I mean when i run the commands
    PrintWriter writer = new PrintWriter(p.getoutputStream());
    writer.println("command");
    the behaviour is not the same. What goes wrong.

    But to load the xml file I need to create a File objectIf this is true then you will not be able to load the XML file, since a jar entry is not a File object and cannot be represented as one.
    However if you get rid of whatever it is that loads your XML file and replace it by more standard JAXP processing, you should be able to parse an InputStream that reads from the jar entry. You know how to get that so it should not be a problem.

  • Can i load and run  .exe file from jar file??

    I generated a .jar file witch contain an executable (.exe file) under a directory called 'exec'. I can't execute this exe file using
    URL urlExecutable = DlgueLancement.class.getResource("/exec/myPrograme.exe");

    import java.io.*;
    import java.util.jar.*;
    import java.util.zip.*;
    public class Extracter
        public static File extract(File archive, String filename, File target) throws IOException, ZipException
            if( archive == null )
                throw new IllegalArgumentException("Null archive file");
            if( !archive.exists() )
                throw new IllegalArgumentException("Specified archive does not exists");
            if( !archive.isFile() )
                throw new IllegalArgumentException("Specified archive file is not a file");
            if( filename == null )
                throw new IllegalArgumentException("Null filename");
            if( filename.length() == 0 )
                throw new IllegalArgumentException("Empty filename");
            if( target == null )
                throw new IllegalArgumentException("Null target");
            if( target.exists() && file.length() > 0 )
                throw new IllegalArgumentException("Target file already exists and cannot be overwritten");
            JarFile jar_archive = new JarFile(archive);
            ZipEntry entry      = jar_archive.getEntry(filename);
            if( entry == null )
                return null;
            InputStream istream = null;
            FileOutputStream ostream = null;
            try
                istream = jar_archive.getInputStream(entry);
                if( istream.available() == 0 )
                    return null;
                byte[] buffer = new byte[istream.available()];
                istream.read(buffer);
                ostream = new FileOutputStream(target);
                ostream.write(buffer);
                return target;
            finally
                if( istream != null )
                    try{istream.close();}catch(Exception e){}
                if( ostream != null )
                    try{ostream.close();}catch(Exception e){}
    }

  • How to make jar files run using java.exe and not javaw.exe

    Hi ,
    I am developing a project in which there is an GUI which inturn will call a console . I have made it into an jar file now.
    Here comes the problem. When i run the jar files , i don't get a console. While going through this forum, i came to know that jar runs using javaw.exe and this stops it from bring the console up.
    Please suggest me a way of running the jar file through java.exe or any other method by which i can get an new console poping up.
    PS : i cannot start the application itself in a system console , because the Console mode is an added feature and it is not to be displayed every time but only when the user intends to.

    Thanks for the reply pbrockway2. But i think, i was not able to convey my problem properly.
    I am supposed to start my application in a GUI mode ( No console are should be present at this point of time). Within the GUI , i have a option for working in the console ( i.e if console is choosen, then i start giving my output and take inputs from the console. I am trying to do this by just calling the "System.out "and "System.in" methods. )
    Here is the problem. As i have started it through " jar " it would not have a associated console with it.
    PS: i cannot have launching .bat file because that would result in my application having a console displayed at the very start of the application. I want the console to be displayed only when the user wants to start in console mode.
    Please suggest me some ways of doing this. Can i create a console from my java program and then exit it.

  • Makeing a .jar file or .exe

    How can I make one of these. I read the tutorial but it doesn't make sense. Do I put the code into the program? Can I run the program on another computer by just taking the jar file on a disk. Can some one inform me and help me understand these compiling things.

    As far as jar files go, you put .class files and dependent data files into a jar. For example, you can put an .jpg into a jar. You can run the application on another computer by copying the jar file to the other computer, assuming you created the jar correctly and the other computer has a compatible JVM installed.
    As far as .exe files go, search the forums here using keyword .exe and you should be able to find some applications that create .exe files. Or try Google.

  • Executing an file.exe from a jar file?

    Does anyone know how to execute an *.exe file from jar file?
    I have two files that I want to execute in one java.class, Monview.exe and Moninit.exe. Both are stored in the same jar file as the class called link.class.
    This is my code to run one of the files from the hard drive
    String []cmd={"c:\\monview.exe"};
    try
    Process pr = Runtime.getRuntime().exec(cmd);
    StringBuffer buf = new StringBuffer();
    InputStream istr = pr.getInputStream();
    BufferedReader br = new BufferedReader(new InputStreamReader(istr));
    String str;
    while ((str = br.readLine()) != null) {      
                             buf.append(str);
    try {       
    pr.waitFor();
    } catch (InterruptedException e) { }
         if (pr.exitValue() != 0) {      
         br.close();
    catch (IOException e){}
    It works when i place both .exe on the local host harddrive but when I place it in the jar file nothing happens. Could anyone help me please on why does this happen and how I can fix it? Or on how to get the link.class code to extract it from the jar file and place it on the system directory and delete it from the system directory, without it knowing where the jar file comes from?

    Hello,
    If I am not mistaken, by including the JAR file in the CLASSPATH (specifying the absolute path), or after the -classpath option after the java command (java -classpath jar_archive main_class), the system will find both files in the JAR archive.
    Hope this helps!

  • Runtime.exe() is not working from within a jar file.

    Hi All,
    I have a jar file which have classes and a package in it.
    One of these classes is calling another class which is present in the package.
    The code i am using it is as follows:
    Runtime r=Runtime.getRuntime();
    Process p=null;
    p=r.exec("java deep.slideshow.PlayShow");It is working fine when i am executing it without making jar file.
    But when i make a jar file of all these things , this exec() is not working.
    I have tried a lot.
    If any body has any idea suggest me.
    Thanks

    thanks a lot for your reply friend.
    I tried the same you tell me to do by using the cmd;
    java -cp my.jar package.class  And then tried to make the jar file with the help of eclipse,
    after adding my jar file into classpath of my project in eclipse.
    Its working fine on my local system.
    But when i put this jar file on some other system it does not call my jar file(obviously bcz it will not the find the jar file according to the classpath set on my local system. )
    Is there any way that i can keep this jar into my project and then can give the classpath dynamically
    so that it can pick the file from my project automatically.?
    Later on i will pack this whole thing into a full jar file and it will work on a single click.
    Is it possible or not ?
    Please suggest me.
    Thanks

  • Converting Jar files into Exe

    Can anyone suggest me a free tools for converting jar files into executable??
    Thanks

    thanks
    i have few questions about launch4j
    my application depends upon other jar files also like log4j.jar etc. Can i merge all the dependencies into the executable itself for better management of file? Is it possible in launch4j??
    and is it possible to extract my source code from executable file using reverse engineering techniques??

  • Please I can not get a .jar file to run on XP SP3 start/run/cmd/

    I can not get a .jar file to run on XP SP3 start/run/cmd/
    Please help if can figure this out. I'm convinced it is a Windows XP SP3 problem from searching on google and seeing other ppl on XP SP3 with same problem (but no working solution for myself). I'll try to be complete-listing all I've done.
    I had installed: Java SE Runtime Environment v6u14 for Windows Multi-language
    I had checked here it was working properly: http://www.java.com/en/download/manual.jsp
    I'm trying to run this jar file (soht-client-0.6.2.jar):
    http://prdownloads.sourceforge.net/telnetoverhttp/soht-java-client-0.6.2.zip?download
    http://www.ericdaugherty.com/dev/soht/javaclient.html < this is the information for the program.
    (yes the file can be executed and should open the program's window
    I wanted to post screenshot of it but friend that it's working for isn't here)
    _(Please find log of all cmds I did in this post here: http://pastebin.com/f792983df )_
    _I have extracted +'all' the files to: C:\062\+_ (I have tried using other directories, same problem)
    ++I then start/open/run/cmd+
    then I: cd C:\062\+
    then I try various commands - all+ of these do absolutely nothing- meaning no errors, no reply, no window opens, nothing except enters that directoy again:
    java -jar soht-client-0.6.2.jar
    java -jar -client soht-client-0.6.2.jar
    java -client -jar soht-client-0.6.2.jar
    java -jar soht-client-0.6.2.jar soht.properties
    soht-client-0.6.2.jar
    So I try this cmd: java soht-client-0.6.2.jar
    Reply:
    C:\062>java soht-client-0.6.2.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: soht-client-0/6/2/jar
    Caused by: java.lang.ClassNotFoundException: soht-client-0.6.2.jar
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Could not find the main class: soht-client-0.6.2.jar. Program will exit.
    I try this cmd:
    java -jar soht-client-0.6.2.jar -client
    Reply:
    C:\062>java -jar soht-client-0.6.2.jar -client
    Unable to load configuration file: -client - java.io.FileNotFoundException: -cli
    ent (The system cannot find the file specified)
    SOHT Java Client
    The SOHT Java Client requires a properties file. Either start
    the application in the same directory as the soht.properties
    file, or specify the file name on the command line:
    java -jar soht-cleint-<version>.jar c:\soht.properties
    So then I do these cmds which produce the exact same error/reply just above; Unable to load..:
    j_ava -jar soht-client-0.6.2.jar -client soht.properties_
    java -jar soht-client-0.6.2.jar -client C:\062\soht.properties
    So then I copy soht.properties to C root and do:
    java -jar soht-client-0.6.2.jar -client C:\soht.properties <same error as above
    Then from other information I have read I right click on the .jar file, select open with Always open with:
    _"C:\Program Files\Java\jre6\bin\javaw.exe"_
    Try again.. same problem.
    Then I do cmd:
    _"C:\Program Files\Java\jre6\bin\javaw.exe" -jar "C:\062\soht-client-0.6.2.jar"_
    does nothing, retry the other commands same thing (either nothing or those same replies)
    Then I read (http://forums.sun.com/thread.jspa?threadID=5384879) someone had the same problem as I and they solved it by uninstalling all Java/reboot/ then install JDK 6 Update 14 with NetBeans 6.5.1 start NetBeans and then it worked for them.
    So I unistalled all Java, rebooted and gave the cmd another try (before re-installing), now a new error, of course:
    C:\062>java -jar soht-client-0.6.2.jar
    'java' is not recognized as an internal or external command, operable program or batch file.
    Then I install  Java SE and NetBeans Cobundle (JDK 6u14 and NB 6.5.1) Final Release/ reboot/ open Netbeans/
    go to test java page; all is good, run cmds again -and still nothing..
    C:\062>java -version
    java version "1.6.0_14"
    Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
    Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)
    I reassociate program with: C:\Program Files\Java\jre1.6.007\bin\javaw.exe_
    same thing.. nothing
    Thank you very much for your time :D_
    PS. My computer has been newly reformatted so needing another reformat I'm sure is not the solution.

    Thank you very much for your replies Taggert_77 & swmtgoet_x :D
    Taggert77_: I have never used NetBeans. I only installed it in the bundle as I had read on another post that somehow installing the bundle magically helped another user with the same problem (he didn't know why it worked after that either).
    Before XP SP3 I was able to execute .jar file through cmd prompt. Now I am not.
    This file is executable, grab it and you will see. Here is a screen shot (program in front is FlashFXP, behind is the cmd prompt and what should happen):http://www.freeimagehosting.net/uploads/53273b4ddf.jpg
    swmtgoetx_: I only did the other cmd's to try to make it spit out something, anything lol :D
    The proper cmd is simply: java -jar soht-client-0.6.2.jar
    I did give your cmd a try, and it produced nothing :( (just like the other correct cmds)
    java -client -jar soht-client-0.6.2.jar soht.properties
    Thank you again...the mystery remains
    PS. If you do a search for this you'll find an amazing amount of XP SP3 users with the same problem and no solution posted that I could find except one chap that did the unistall install order that I did above).

  • Help adding new files to Jar file.

    I am new to Java and am having problems haveing our Web App work after I have recreated the JAR file...this is what I did...
    Changed to the following directory at a dos prompt:
    D:\jdk1.3.1_01\bin
    Ran the following to extract the files from the jar file.
    jar xvf app2.jar
    ...this created 5 directories with various files.
    copied new and updated graphic files to
    D:\jdk1.3.1_01\bin\app2\images
    Recreated the jar file using the following command (pv com javavp meta-inf borland are the 5 directories that were extracted from the original jar file above):
    jar.exe cvf app2.jar pv com app2 meta-inf borland
    I now have a new jar file that is a similar size, so it looks good, but when I put it in our web site, it does not recognize certain frames (that get information from the database) that it did before (the frames are blank)
    Any thoughts on what I am doing wrong?
    Also, are there any Windows programs that i can use to make this easier instead of using the dos commands?
    Thanks...

    To change the contents while inside a java program, you might be able to use Runtime.exec(String[]). Make the array with "jar.exe" as the first index, flags in the second, and remaining arguments in the remaining indecies.

  • How can I create an Install.exe(Application file)

    I need urgent help on how to create an Install.exe (Application file) for my java programs.
    I have compile the java file and run the programs within Jbuilder35 all worked well. I even created a single jar file for all the programs classes file. But my problem was how to create Install.exe (Application file) in other to be able to use it as an application in any computer.
    I mean, for example: Jbuilder35 was developed with java file, and I installed (JBuilder Install.exe, application file) in my computer before I could be able to use it. That is exactly what I dont know how to do it with my java programs that I developed. Any help please?.

    Use InstallAnywhere. They have a free trial addition.
    http://www.zerog.com/downloads_01.html

Maybe you are looking for

  • I need the copy of a receipt from January 2013

    I need to get a copy or my receipt for the purchase of a denon avr1913 from jan 2013 for a warranty repair if possible, Purchase was made online and picked up at: 1240 MARVIN RD NE LACEY, WA 98516 Phone:  360-412-7451Thanks

  • Captilaisation date change

    Experts, I need to change the capitalization date for the asset purchased. That can be done through AS02. Asset purchased on Oct 2008 and the same has to be changed as Sept 2008. Depreciation run for sept and oct 08 already done. Now we need to chang

  • HT1846 32 bit or 64 bit version of Windows 7

    I have the 2007 MacBookPro3,1, Intel Core 2 Duo, 2.4 GHz. Should I purchase the 32 bit or 64 bit version of Windows 7 to run with Boot Camp? Thanks!

  • JDeveloper - create csv data control adapter

    Oracle 10.1.3.4 Following tutorial of creating data control adapter. I can see the csv file in my System Navigator but 1) can't right click to select Create Data Control AND 2) can't drag and drop csv to data control pallete. According to oracle's do

  • Satellite L doesn't boot up after restart or shutting down

    Hello, My laptop after restart or shutting down doesn't starting. I need to turn off the computer and wait 10 seconds and try again, after that it start ok. Any suggest? Thanks, Dvir