Java -jar -myApp.jar works but ....

Hi there,
I have a problem : using ant, I have exported my application into an executable jar file.
When in the console, I type "java -jar myApp.jar" . Everything works well.
But if, I do double click on the jar file, nothing happens. In fact, I can see a new Instance of javaw.exe in the "task manager" but nothing happens.
It's kind of weird ...
Has anybody an idea about that ??
thanks in advance
sylvain_2020

I am having a similar problem.
java -jar foo.jar works great, but double clicking seems to hang the app at a certain point.
Unable to figure out what's going on, I've been putting some "JOptionPane.showMessageDialog()" calls to see how far it's getting. It appears to be hanging up when it tries to instantiate one of my classes that extends JPanel. I have a dialog appear right before calling the constructor (and I see that one), but I don't see the dialog that's in the constructor as the first executed line (so that it must hang up somewhere before that). I've also removed all constructors from the attribute declarations. That made me think it had something to do with the constructor of JPanel, over which I have no control.
However, I can instantiate JPanel no problem.
What the heck is going on???

Similar Messages

  • Java files work but jar files do not

    Hello everyone!
    My java files run normally and I get a response that I expect (which is successful). Imagine my surprise when I collected them in a Jar and the very same files inside the jar no longer work! I get a response (still generated by my java program) from successful, it turns to Query Expire.
    My problem is, when executed as normal java programs, the expected result is produced. However, when the jars are executed, the result is expired. What is wrong? The classes and the ones in the jar are the same. Is there something different with the mechanism of Jars that make it erroneous?
    Many thanks in advance. I have been working with this for a week with no progress! =(

    Hi!
    Thanks for your reply. Here's what's happening so far:
    I created my java files using Eclipse and using the Export option, I exported them as a JAR.
    When I run my application on Eclipse with the Java files in tow, the output I expect is Done sending: wait for responses now
    Received response from billing api- A: null(0), C: 13, E: Account already registered
    Register: Failed: 1 Failure(s)Now, on to the JAR file.
    I executed the JAR file using the command java -jar <jar name.jar>
    Here's the response:
    Done sending: wait for responses now
    Received response from billing api- A: null(0), C: -1, E: Query expire w/o response
    Register: Failed: 1 Failure(s)My program communicates with a database and this generates the reply that should be received by my program. My ordinary Java file gets the expected output, but the JAR does not.
    Is it possible that the JAR file somehow slows down the transaction? The reply sent by the database isn't received by the JAR -- somehow, the message gets lost.

  • Java works, but jar and javac don't

    java at the command line works, but jar and javac don't
    could it be the CLASSPATH
    I'm running Windows if that helps. If you need more info ask away
    Thanks
    CINC

    Definitely sounds like the classpath problem. From the sounds of the error message, you are using win95/98/ME, and so the best way to get around this is to set the classpath in your autoexec.bat file. I think the problem is because you have to set 2 variables in your path, one for the running of the java (JRE) and one for the tools to process the uncompiled files (SDK);
    rightclick on your autoexec.bat and select Edit
    here is my path, change yours accordingly so the paths lead to your windows, command and bin directories accordingly.
    PATH=D:\WINDOWS;D:\WINDOWS\COMMAND;D:\PROGRAM FILES\JAVASOFT\J2SDK1.4\BIN
    SET CLASSPATH=.;D:\PROGRAM FILES\JAVASOFT\J2SDK1.4\BIN\TOOLS.JAR
    Theres a section on setting classpath in This site at :
    java.sun.com/j2se/1.3/docs/tooldocs/win32/classpath.html
    and if that doesn't work, then i recommend you download and IDE which sorts ou most of these problems for you, and makes programming much easier also :)
    anything from:
    Suns Forte
    Jcreator
    Jbuilder
    to a real heavyweight which i use and find indispensible called Visual Age for Java, which is so powerful, but not for the faint hearted or weak-computered. :P
    Good Luck
    Benji

  • .jar includes jdbc driver but doesn't work

    Hi
    I'm quite new with Java. I've just created my first app in java, it's some kind of CMS. I have to give to my friend who can only install JVM and I can't set up his computer, because he lives in other city. What's the problem then:
    I tried to compile (build) complete file with jdbc driver. And actually I've done it (when I open jar with winrar I see that mysql-connector.jar is there) but it's not working. I still have error:
    SQLException: com.mysql.jdbc.Driver
    No suitable driver
    08001
    It works fine when I'm running it with NetBeans, but built jar doesn't work at all.
    Please help me with this problem. I was searching in many forums for the same problem, but no one had it (I mean EXACTLY the same). I have had many problems already with adding connector to NetBeans project at the beginning, but finally I've done it after 2 days - reinstallation of NB solved the problem. Is it possible that's NB fault again?
    Thx for any clues
    Michael

    Hello,
    Try to include a Class-Path option in the Manifest of your jar and see if that works.
    Hope this helps

  • Jar doesn't work while java work fine

    I have a similar but not same case as "Please Help, jar file don't work" that is on 4/20. My program works fine by java class execution, but when I put them to jar it generates NullPointerException. The program get data from separate csv files. The error I get by executing jar is quite same as when I delete csv files and execute java. Only one jar file involves. csv files are in the same directory as class files.
    - My manifest file is;
    Manifest-Version: 1.0
    Class-Path: .
    Main-Class: MetricConverter
    Created-By: 1.4.2_07 (Sun Microsystems Inc.)
    I tried different Class-path possibility, but same result.
    java.lang.NullPointerException
    at MenueMaker.cahrtMaker(MetricConverter.java:71)
    at MenueMaker.<init>(MetricConverter.java:53)
    at MetricConverter.MetricConverter(MetricConverter.java:81)
    at MetricConverter$1.run(MetricConverter.java:33)
    at java.awt.event.InvocationEvent(EventQueue.java:178)
    at java.awt.EventQueue.dispatchEvent(Unknown Source:454)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source:151)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source:145)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source:137)
    at java.awt.EventDispatchThread.run(Unknown Source:100)
    Classes used in the program are;
    MetricConverter (Main) that has >$1
    MenueMaker that has > $1,$2,$3,$4,$5
    ReadCSV
    When I delete csv files from the directory and execute java, the following line is added to 1st line of above Exception message.
    at ReadCSV.readCSV(MertricConverter.java:272)
    The following is chartMaker method;
    public void chartMaker(){
    String[][] gotChart=null;
    chart=new String[4][][];
    int index=0;
    for(int i=0; i<4 ; i++){
    URL pickURL=getClass().getResource("csv"+i+".csv");
    ReadCSV file=new ReadCSV();
    try{
    gotChart=file.readCSV(pickURL,0);
    }catch(IOException e){}
    int a1=0;
    int a2=0;
    while(a1<gotChart.length){
    while(a2<gotChart[a1].length){
    a2++;
    a1++;
    index=i;
    chart[index]=new String[a1][a2];
    chart[index]=gotChart;
    I have looked every place I can imagine for a day, but found no answer. Since it works fine with java it should be with jar archiving.
    Any advice will be appreciated.
    Thanks.

    atmguy, thanks for sticking with this.
    I spend a half day again studying this.
    A new founding that is jar is getting csv files from outside of jar archive.
    My command to make jar is "jar cvfm MetricConverter.jar mym *.class si.au source"
    source folder has 4 csv files. and result is,
    added manifest
    adding: MenueMaker$1.class(in = 809) (out= 515)(deflated 36%)
    adding: MenueMaker$2.class(in = 699) (out= 472)(deflated 32%)
    adding: MenueMaker$3.class(in = 589) (out= 398)(deflated 32%)
    adding: MenueMaker$4.class(in = 1714) (out= 950)(deflated 44%)
    adding: MenueMaker$5.class(in = 667) (out= 436)(deflated 34%)
    adding: MenueMaker.class(in = 5168) (out= 2824)(deflated 45%)
    adding: MetricConverter$1.class(in = 349) (out= 247)(deflated 29%)
    adding: MetricConverter.class(in = 1068) (out= 677)(deflated 36%)
    adding: ReadCSV.class(in = 1459) (out= 913)(deflated 37%)
    adding: s1.au(in = 55708) (out= 44941)(deflated 19%)
    adding: source/(in = 0) (out= 0)(stored 0%)
    adding: source/csv0.csv(in = 543) (out= 254)(deflated 53%)
    adding: source/csv1.csv(in = 765) (out= 365)(deflated 52%)
    adding: source/csv2.csv(in = 340) (out= 191)(deflated 43%)
    adding: source/csv3.csv(in = 1004) (out= 497)(deflated 50%)
    Double Clicking MetricConverter.jar with the source folder in the same directory open the program even copying them to other directories. However, from desk top or my document doesn't work (seems to me space in the directory name?). Without source folder console shows NullPointerException at ReadCSV.. The program cannot find csv files.
    Another thing that is the program only works when manifest file has class-path : . and <cade> URL pickURL=getClass().getResource("./source/csv"+i+".csv");
    has ./.
    I tried making source.jar and putting index using "jar -i MetricConverter.jar" with "class-path: source.jar" in manifest, and use jnlp, but nothing works.
    You seems to me an experienced java programer. If you don't mind look this at www.mixvision.net/java/MetricConverter.jnlp, also I leave www.mixvision.net/java accessible for now.
    Thanks again.

  • .jar file only works with 'java -jar'

    I have a .jar file that contains an installer. When I double click it nothing happens on my work computer (vista32). I have tried moving it to my home computer (vista64 and winXP) there it works fine when I double-click it.
    I have found a temporary solution for the work/vista32 machine. If I run it with:
    java -jar installer.jar
    it works. I have put this in the target of a shortcut to the file. But why do I need to do that manually when it works fine on my other machine by just double clicking the file?

    fedevaps wrote:
    Thing is that if I move this jar to another machine it works fine! The thing is that you are missing the point.
    It has nothing to do with the jar. Nor really java.
    Double clicking works because the OS (windows not java) understands what to do when you double click.
    If the OS (windows not java and definitely not the jar) does not understand then it doesn't work.
    So there are two independent parts.
    1. Create an executable jar.
    2. Create the correct association in windows.
    If you use the command line then you can absolutely verify that the first works. If it works then it means, absolutely (no other possibility) that if double clicking fails then the association, not the jar, is wrong.
    If it doesn't work then it means absolutely (no other possibility) that the jar, not the association, is wrong.

  • JDev 11 on linux with java -jar jdevstudio11110install.jar not working

    My environment was working great until a few days ago, then kaboom. Now I'm trying to pick up the pieces and can't seem to be able to install JDeveloper. I am using Fedora 10.
    Logged in as myself, the default version of java is 1.6.0_13.
    $ java -jar jdevstudio11110install.jarI get the install screen. I can't press the next button. It just won't work. I then CTRL-C to get back to the terminal, and with this version of Java, I have to kill -9 the PID found using the command
    ps -efIf I perform the same steps as root, I can install JDeveloper, but then I can only run it as root. When launching jdev as myself, I get a blank "Select Role" screen.
    Thanks, Ken

    Olaf,
    I uninstalled 1.6.0_13, and installed 1.6.0_12, and still have the problem of not being able to press the next button. Here is the text from my terminal window. After not being able to click the next button, I switched windows and when I switched back, the Oracle window was empty of content. I pressed CTRL-C to close the window.
    I checked, and I don't have selinux running. Below is from my yum.log that shows updates for the last few days. I don't know if any of these caused the problem, but I really am not sure. I'm getting to the point of needing to run jdeveloper in windows in a virtual machine...
    [klee@c5ybv91 Download]$ java -Djava.io.temp=/home/klee/temp -jar jdevstudio11110install.jar
    Extracting 0%....................................................................................................100%
    ^C[klee@c5ybv91 Download]$
    [klee@c5ybv91 Download]$ java -version
    java version "1.6.0_12"
    Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
    Java HotSpot(TM) Server VM (build 11.2-b01, mixed mode)
    [klee@c5ybv91 Download]$ Here is the contents of my yum.log for the last few days.
    Mar 23 07:46:54 Updated: thunderbird-2.0.0.21-1.fc10.i386
    Mar 23 07:46:56 Updated: liveusb-creator-3.6.3-1.fc10.noarch
    Mar 23 07:47:14 Updated: ghostscript-8.63-5.fc10.i386
    Mar 24 09:13:12 Updated: selinux-policy-3.5.13-49.fc10.noarch
    Mar 24 09:13:51 Updated: selinux-policy-targeted-3.5.13-49.fc10.noarch
    Mar 24 09:13:54 Updated: libX11-1.1.5-1.fc10.i386
    Mar 24 09:13:57 Updated: ffmpeg-libs-0.4.9-0.55.20080908.fc10.i386
    Mar 24 09:14:04 Updated: gtk2-2.14.7-7.fc10.i386
    Mar 24 09:14:20 Updated: 1:java-1.6.0-openjdk-1.6.0.0-11.b14.fc10.i386
    Mar 24 09:14:21 Updated: lcms-libs-1.18-1.fc10.i386
    Mar 24 09:14:22 Updated: postgresql-libs-8.3.7-1.fc10.i386
    Mar 24 09:14:22 Updated: lcms-1.18-1.fc10.i386
    Mar 24 09:14:25 Updated: 1:java-1.6.0-openjdk-devel-1.6.0.0-11.b14.fc10.i386
    Mar 24 09:14:25 Updated: 1:java-1.6.0-openjdk-plugin-1.6.0.0-11.b14.fc10.i386
    Mar 24 09:14:26 Updated: ffmpeg-0.4.9-0.55.20080908.fc10.i386
    Mar 24 09:14:26 Updated: xorg-x11-drv-vesa-2.2.0-3.fc10.i386
    Mar 24 09:14:31 Updated: libX11-devel-1.1.5-1.fc10.i386
    Mar 24 09:14:40 Updated: gtk2-devel-2.14.7-7.fc10.i386
    Mar 24 09:14:40 Updated: ffmpeg-devel-0.4.9-0.55.20080908.fc10.i386
    Mar 24 09:17:01 Installed: kmod-wl-2.6.27.19-170.2.35.fc10.i686-5.10.79.10-1.fc10.i686
    Mar 24 09:17:01 Installed: kmod-wl-5.10.79.10-1.fc10.i686
    Mar 24 09:17:01 Installed: broadcom-wl-5.10.79.10-1.fc10.noarch
    Mar 25 10:29:22 Installed: 1:java-1.6.0-openjdk-1.6.0.0-11.b14.fc10.i386
    Mar 25 10:29:22 Installed: 1:java-1.6.0-openjdk-plugin-1.6.0.0-11.b14.fc10.i386Before the 23rd, I didn't have any updates for about a week, and everything was working fine.
    Thanks,
    Ken

  • JAVA command line options -cp and -jar don't work together?

    Running JSDK 1.4.2 under Windows. I have a Java application that tries to dynamically load a class name that the user enters as follows:
    try {
    classResult = java.lang.Class.forName(strFilterName);
    catch (ExceptionInInitializerError e) {
    strErrorMessage = "ExceptionInInitializerError loading class: " + strFilterName;
    catch (LinkageError e) {
    strErrorMessage = "LinkageError loading class: " + strFilterName;
    catch (ClassNotFoundException e) {
    strErrorMessage = "ClassNotFoundException loading class: " + strFilterName;
    This works fine if the classes that make up my application are left as class files in the classpath, but fails to work if they have been collected and run from a JAR file. Note: I can even dynamically load the class when running from the JAR file, if the class I'm trying to load is within that JAR file too. The problem really occurrs when the dynamically loaded class is located someplace else in my classpath. I've tried using various combinations of the "-cp" and "-jar" Java command line options - but when loading and running from a JAR file - the "-cp" parameters seem to be ignored. Is this a bug? Has anyone ever seen this before?
    I run my program from the JAR file using this command:
    java -cp .;e:\entmgr\filters -jar EntMgr.jar
    Where "e:\entmgr\filters" is where the class I'm trying to dynamically load is. (This class has no package name, but loads perfectly as long as I'm not running the application from the JAR file). The class name specified by the user has to be fully specified with a package name (if it has one).
    I have tried forcing the "java.lang.Class.forName(strFilterName);" call to use the system class loader, the parent of the system class loaded, and even the null bootstrap class loader - all with no success.
    I am suspecting that the class loader that is loading and running my main program from the JAR file, is just not paying any attention to the "-cp" parameter when the "-jar" parameter is present. Indeed, I have never seen any change in the failure, no matter what I put in the "-cp" parameter when using the JAR file.
    When I run this without using the JAR file, here is the command I execute:
    java -cp .;davidp\snmp;filters davidp.snmp.EntMgr
    Where this is executed in a directory that has a "filters" and "davidp\snmp" directory. In this case, because the "filters" directory is in my class path - I can dynamically load my class from it using just its simple name (i.e. "TestTrapFilter").
    So, is there some bug that precludes the "-cp" parameter from working correctly when the "-jar" parameter is used? Is there some other way to initialize or set up the classloader I'm using, so it can find things outside of the JAR file I'm running from? I would hope that it is possible to get the same behavior from my program, no matter if it is run from a JAR file or not.
    Thanks for any assistence!
    Dave

    These posts are pretty old, but this page came up in a google search while I was having the same problem, so I thought I would throw my own (Later found) solution in.
    The -cp and -jar options did not work together for me, but I later learned that they didn't really have to (and you don't have to mess with jar manifest files).
    While on the command line, if you want to set a specific class path and also run a jar, all you need to do is add the jar to whatever extra class path you need to use in the -cp <arg>, and then specify which class you want run from inside the jar.
    IE:
    java -cp <YourSpecialClasspath>: <PathToJar> <ClassToRunInsideOfJar>
    in my case it was like:
    java -cp /home/user/WebRCP.jar:./StandaloneInstaller.jar InstallLoader
    Remember to put a ":" in between the two arguments for the class path (-cp).
    Hope this helps someone in the future,
    -Josh

  • Jar cvfm ..\MYAPP.jar ..\mf.txt .

    Hi all,
    I am following directions from http://www.codeguru.com/forum/showthread.php?threadid=279029
    but when I got to
    jar cvfm ..\MYAPP.jar ..\mf.txt .
    It doesn't work, it says, "'JAR' is not recognized as an internal or external command"
    I am assuming that it doesn't know what "JAR" is , but what have I missed???
    Thanks,
    Mike

    You need to set your java bin's directory to your System environment variable PATH.
    I guess you are working under Windows.
    For instance:
    Let assume that you have installed your J2SDK in C:\j2sdk1.4.2 directory.
    You need to add "C:\j2sdk1.4.2\bin" to your PATH.
    To add do:
    1) Click "Control Panel"
    2) Click "System"
    3) Click "Advanced" tab
    4) Click "Environment Variables"
    5) Click on Variable "Path" row under System variables box.
    6) Click "Edit"
    7) Add "C:\j2sdk1.4.2\bin". Remember to add ";" as the separator between directories name.
    8) Click "OK"
    The MS-DOS prompt should be able to find "jar" now.
    Remember to change the J2SDK directory as what you installed in your system.

  • JAR No longer works

    So I had a JAR for an app I wrote months ago, but don't use all that often. I went to run it today, and got the 'main class not found' error. I hadn't installed any JDK updates or anything, or altered my classpath, so I'm not sure what would cause it to work a few weeks ago, but not today.
    Manifest:
    Manifest-Version: 1.0
    Created-By: 1.6.0 (Sun Microsystems Inc.)
    Main-Class: TableConstructor.TableMakerContents of JAR:
    H:\Apps\TableMaker\1.3>jar -tf TableMaker.jar
    META-INF/
    META-INF/MANIFEST.MF
    TableConstructor/DisplayTableFrame.class
    TableConstructor/Field.class
    TableConstructor/Table.class
    TableConstructor/TableFileParser.class
    TableConstructor/TableGenerator.class
    TableConstructor/TableMaker$1.class
    *TableConstructor/TableMaker.class*
    TableConstructor/TableMakerGUI$RowPanel.class
    TableConstructor/TableMakerGUI.class
    TableConstructor/TableSaver.class
    TableConstructor/DisplayTableFrame.java
    TableConstructor/Field.java
    TableConstructor/Table.java
    TableConstructor/TableFileParser.java
    TableConstructor/TableGenerator.java
    TableConstructor/TableMaker.java
    TableConstructor/TableMakerGUI.java
    TableConstructor/TableSaver.javaThe TableConstructor/TableMaker.class is clearly in the JAR, so I'm not sure why it can't find it. Here's the code for the main class, to show that it is correctly in the TableConstructor package:
    package TableConstructor;
    public class TableMaker {
        public static void main(String[] args) {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    new TableMakerGUI();
    }What am I missing? I'm terrible with JARs, any help is appreciated.

    newark wrote:
    Thanks for the input. Running it manually as you suggested results in the application launching perfectly. Any clue then what might be wrong with my manifest? As I said, this used to run just fine by double-clicking the JAR (using XP). Is this a version issue?Oh, it does not work when double-clicking? Then try this on the command line.H:\Apps\TableMaker\1.3>java -jar TableMaker.jar If that works, then your manifest is Ok, but your computer file association is hosed.
    Open any Windows folder, go to Tools menu, Folder Options.
    Select File Types tab
    Scroll down to JAR, click on it and select Advanced.
    It should have open under Actions. Click on open and click on Edit.
    You should have something like "C:\Program Files\Java\jre1.6.0_02\bin\javaw.exe" -jar "%1" %*depending on where your jre is stored and what version it is.

  • Javac is working but not java

    PLEASE HELP.
    I've got a project due very soon, and I can't get very far until I can run my apps.
    Thank you,
    Dustin
    1.
    I CAN compile a single .java file if it does NOT refer to any class outside of itself.
    2.
    I CAN'T compile a .java file if it refers to another class outside of itself (even if it's with in the same directory.
    3.
    If I comment out the line that refers to an outside class then I can compile the .java file.
    HOWEVER, When I run the 'java Ap00.class' command, I get this error:
    Exception in thread "main" java.lang.NoClassDefFoundError: Ap00/class.
    This also applies to the above part 1. I can't work the .java command no matter what.
    4. Here is my
    classpath:
    ".;C:\j2sdk1.4.1_01\lib;C:\Prog\AudioPlayer;"
    Path:
    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\PROGRA~1\ULTRAE~1;C:\Program Files\Common Files\Autodesk Shared\;C:\j2sdk1.4.1_01\bin
    They look alright to me.
    5. Yes, this program used to run just fine. I have not altered it. Everything got screwy when I upgraded to WinXP.
    6. Everything works fine inside of a an IDE like Forte.
    Ap.00 compiles and runs.
    It seems that the answer is right under my nose, but I just can't put it together.

    Open a console window.
    Type the following
    echo %CLASSPATH%
    The output is your class path. (Do not guess what it is. Follow the above to find out exactly.)
    Your classes do NOT have packages right?
    You can test a class path with the following even if there is no 'main' in the class.
    java MyClass
    If you run the above and you get a no class found error, then your class path is wrong. If you get a 'no main' (or it runs) then the class path is right.
    This part of your classpath "C:\j2sdk1.4.1_01\lib" is non-sensical. I doubt you are putting your classes in there. And java itself uses jars and that will not pick them up. Remove it.
    When you run you are in the directory where the class files are correct? Or they are in "C:\Prog\AudioPlayer"

  • Jar download not working over dial up

    Hey,
    Our webstart application works just fine while connected to the lan at work. The various jars required by the application are downloaded without any problems.
    However, when I try to access the same application over dial up (I have tried netzero and aol), the jar download fails in a rather weird fashion.
    On clicking on the link for the application, the main jar e.g. main-application.jar downloads just fine, but the next jar in line fails with the following message
    Unable to load resource: https://server.com:443/application/lib/axis.jar
    Exception
    JNLPException[category: Download Error : Exception: java.net.SocketException: Unexpected end of file from server : LaunchDesc: null ]
         at com.sun.javaws.cache.DownloadProtocol.doDownload(Unknown Source)
         at com.sun.javaws.cache.DownloadProtocol.getResource(Unknown Source)
         at com.sun.javaws.LaunchDownload.downloadJarFiles(Unknown Source)
         at com.sun.javaws.LaunchDownload.downloadEagerorAll(Unknown Source)
         at com.sun.javaws.Launcher.downloadResources(Unknown Source)
         at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
         at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Wrapped Exception
    java.net.SocketException: Unexpected end of file from server
         at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
         at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at java.net.HttpURLConnection.getResponseCode(Unknown Source)
         at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
         at com.sun.javaws.net.BasicNetworkLayer.doRequest(Unknown Source)
         at com.sun.javaws.net.BasicNetworkLayer.doGetRequest(Unknown Source)
    Now, when i click on the application launch again, it proceeds to download the next jar e.g axis.jar in this case without a problem, but it will fail on the next jar
    snippet from my jnlp file
    <jar href="application.jar"/>
    <jar href="lib/axis.jar"/>
    <jar href="lib/castor-0.9.5.2-xml.jar"/>
    <jar href="lib/commons-beanutils-1.5.jar"/>
    <jar href="lib/commons-collections-2.1.jar"/>     
    Note : All of this works fine when im not using dial up to connect.
    Does anyone have any ideas ?
    Any help is greatly appreciated

    pboeykens,
    It may definitely be something with my network and/or firewall configuration. I'm just not sure where to look yet.
    I have tried modifying apache settings to no avail.
    I've tried turning KeepAlives off, changing the keep alive timeout and the max number of keep alives allowed on apache, but none of these setting changes had any effect on the jar download.
    If you have any suggestions for what I might look at as far as my firewall settings, then I can take that to my security department.
    My next step is to try and enable the debug logging with webstart to maybe get a better idea of why it thinks that no jar is available.
    Thanks

  • Java -jar application.jar not finding file?

    I have an application program that contains the
    following two lines of code:
    FileInputStream sf = new FileInputStream "CustomWorld.ini");
    settings.load(sf);
    and when I run it as:
    java application
    it runs fine but if I run it as:
    java -jar -classpath .;application.jar application.jar
    it can't find the "CustomWorld.ini" file. Why is that
    and how can I fix it?
    Many thanks for your help.
    PS: to create the jar file I used:
    jar -cvfm application.jar application.mf application.class CustomWorld.ini

    Once your CustomWorld.ini file is in the jar, you can no longer access it directly with a FileReader. JDK 1.1 included resource locators to java.lang.Class...
    URL url = application.class.getResource("/CustomWorld.ini");
    if (url != null) { // resource was found
       InputStream in = url.openStream();
       settings.load(in);
    } else {
       // fail gracefully or use defaults
    }Note that the CustomWorld.ini file will need to be in the classpath or the root folder of the jar file for this to work.
    Regards,
    -Troy

  • Java -jar Test.jar  option is not identifing the CLASSPATH on UNIX BOX

    Hi All,
    java -jar Test.jar
    I am trying to execute Test.jar file using -jar option. I am able to excute the Test.jar file but it is not identifing the CLASSPATH set for other JAR files which is used in part of Test.jar. Saying java.lang.NoClassDefFoundError: for the class which are set in CLASSPATH.
    The same is able to identify the CLASSPATH if i excute the Test.class file directly with out -jar option like
    java Test. In this case everything is working fine.
    Can any one tell me why it is not identifying the classpath if i use or execute with java -jar Test.jar option.
    Thanks,
    sha

    When you use the -jar option, the only classpath that is used is the Class-Path in the manifest file of the jar. If there is no Class-Path, then only the jar is searched for classes. If there is a Class-Path, the paths must be relative to the jar file.

  • Java Application as jar File cannot connect to SAP via JCO

    Hey guys,
    I wrote a test class to play a little with the java connector. Everything worked fine.
    Now I want to pack my java class and the JCO classes in one jar file. I have written a manifest file with the Main-Class statement and after I start the jar file I got following exception:
    Exception in thread "main" java.lang.ExceptionInInitializerError: JCO.classIniti
    alize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
    JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [no sapjco
    rfc in java.library.path]. java.library.path [C:\WINDOWS\system32;.;C:\WINDOWS\S
    ystem32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\Ja
    vaConnector\sapjco.jar;C:\j2sdk1.4.2_12\bin;]
            at com.sap.mw.jco.JCO.<clinit>(JCO.java:776)
            at de.lymez.sti.SAPAufruf.getDocnr(SAPAufruf.java:26)
            at de.lymez.sti.Aufruf.main(Aufruf.java:12)
    Can anyone help me? I don't think that I forget something during the JCO installation, because my class file worked fine and give me the correct values out of the SAP System.
    Best regards,
    Timo

    Thanks Vladimir,
    but I followed the Tutorial and copied every dll in the wright folder and set the pathes. In one of the threads someone told about a tool named dependency walker. I used this with the sapjcorfc.dll and the tool answered that the DRVADODB.DLL is not found. Can anyone send me this dll? And why worked everything fine, when I use the class? I only have problems when I use one jar file!
    Thanks for any help!!
    Regards,
    Timo

Maybe you are looking for