Jar Manifest with JVM arguments

It is possible to get VM argument from manifest, if it is, how to do ?
if not how it possible to get VM argument in executable jar file ?
Thanks all
s@id

Hi everybody,
I happy, that I'm not the only one suffering from this limitation. Right now I'm writing a Java application which will be used not only by persons who have Java experience. I guess most of them wouldn't even know how else to start it than double-clicking on the jar-file. And in my opinion, that's perfectly alright! When starting an native executable, you also don't think about defining a maximum heap size and even non-developers can easily use these applications. But I don't what to start if native applications are better or not. I really love Java and I don't want to miss it, that's for sure.
But I don't understand, why on the one hand Java tries to "sell itself" as a real alternative to native applications and one the see the intention to let Java applications more and more "feel" like them (e.g. with introduction of features like TrayBar support or making it easy to open/edit/... files with any application assigned to that file type), but on the other hand there is no official way to easily setup the environment to start these Java apps. I mean, you can use Applets or the WebStart facility for deployment, but that can't be the right way! I can think about so many applications which I would really like to have as a real offline tool. What is, if the PCs I want to use my app on don't have an internet connection?
Ok, but to make a long story short, I'm really looking for any way to make it easy for the users of my application to "just use it" rather then telling them when how to increase the maximum heap size or which script they have to use to run it. And the only way I see right now is the idea of using a wrapper just for starting a new VM with additional parameters. Even this is a bad hack in my opinion, but I'll try if this is useful for me.
Anyway, I hope that maybe someone already found a better solution cause I can't believe that this problem is really uncommon.
If I find a better solution I'll let you know.
Regards,
Black Widow

Similar Messages

  • Jar-files with vm-arguments

    Hi,
    If I run the junit-tests in eclipse then there are no problems. When I run in jar-files format then it need the vm-arguments(Exception:Arguments not set). How can I pass arguments the my jar-files?
    Thank you.

    Hi everybody,
    I happy, that I'm not the only one suffering from this limitation. Right now I'm writing a Java application which will be used not only by persons who have Java experience. I guess most of them wouldn't even know how else to start it than double-clicking on the jar-file. And in my opinion, that's perfectly alright! When starting an native executable, you also don't think about defining a maximum heap size and even non-developers can easily use these applications. But I don't what to start if native applications are better or not. I really love Java and I don't want to miss it, that's for sure.
    But I don't understand, why on the one hand Java tries to "sell itself" as a real alternative to native applications and one the see the intention to let Java applications more and more "feel" like them (e.g. with introduction of features like TrayBar support or making it easy to open/edit/... files with any application assigned to that file type), but on the other hand there is no official way to easily setup the environment to start these Java apps. I mean, you can use Applets or the WebStart facility for deployment, but that can't be the right way! I can think about so many applications which I would really like to have as a real offline tool. What is, if the PCs I want to use my app on don't have an internet connection?
    Ok, but to make a long story short, I'm really looking for any way to make it easy for the users of my application to "just use it" rather then telling them when how to increase the maximum heap size or which script they have to use to run it. And the only way I see right now is the idea of using a wrapper just for starting a new VM with additional parameters. Even this is a bad hack in my opinion, but I'll try if this is useful for me.
    Anyway, I hope that maybe someone already found a better solution cause I can't believe that this problem is really uncommon.
    If I find a better solution I'll let you know.
    Regards,
    Black Widow

  • How to pack .class or .jar with jvm into an exe file?

    In fact, .class or .jar files are middle layer files who need JVM to explain and run them. Sometimes it's unconvenient. Why not provide some tools to pack .class or .jar with jvm into exe file?

    because java should be able to run on any OS. That is why SUN doesn't provide such tool. There are other company's who does provide such tool. Like JBuilder enterprise

  • How to run jar files with arguments?

    Hi everybody,
    Is it possible to run a jar file with arguments passed to its MAIN class?
    If yes can you help me on how to do it?
    Thanx

    I am in complete agreement with FahleE. I'll refine it a bit.
    On my machine (running RedHatLinux8.0) you can run the demos like this.
    1. open a console window
    2. go to the directory where the demo you wish to run, say, demo.jar, is located
    for instance for the SwingSet2-demo
    cd /usr/lib/java/demo/jfc/SwingSet2
    3. run the jar file
    java -jar demo.jar
    In order to run it windows style, ie, launching by double clicking, save these lines in a file called
    LaunchJar.sh
    cd /usr/lib/java/demo/jfc/SwingSet2
    java -jar demo.jar
    where demo.jar is the jar file you want to run.
    Right click on the LaunchJar.sh and go to the 'Properties' tab. Check the 'Execute' permissions for Owner/groups/others. You can also do the same thing by chmod command.
    Now double-click on the LaunchJar.sh file: your application should be launched.
    Palash.
    Please Note: It is important to set the path variable to your JAVA_HOME directory....
    Otherwise, instead of
    java -jar demo.jar, you will need to use the full path to your JAVA_HOME/bin directory like:
    JAVA_HOME/bin /java -jar demo.jar.
    Where JAVA_HOME is the directory where you have installed java. Typically it is usr/java or usr/local/java

  • How to run a java class from a shell script with passing arguments

    hi,
    I have a jar with all the required classes. I was using ant to run the classes i needed.
    But now i want to use a shell script to run the class, also the class accepts some arguments so when script is run it should accept arguments.
    So can any one tell me how to set class paths, jar location and call the required class from shell script or batch file with passing arguments to it.
    Thanks in advance.

    Let's say that the order of arguments is as below
    1. Jar file name
    2. Classpath
    Your shell script would look like this
    java -cp $CLASSPATH:$2 -jar $1 I am assuming that your jar file has the required main-class entry in its manifest. Note that $1...$9 represent the arguments to this shell script.
    The same goes for a batch file
    java -cp %CLASSPATH%;%2 -jar %1

  • Specified in jnlp jvm argument but not   applied   by browser

    jlnp file specifies passing passing vm arguments   using java-vm-arguments attribute , it also provides list of acceptable arguments  as mentioned here http://docs.oracle.com/javase/7/docs/technotes/guides/javaws/developersguide/syntax.html.
    In my case , jvm argument  is   -Djava.security.debug=sunpkcs11,pkcs11. I added   this to jlnp file but this  is never loded by the browser jvm.  This is not mentioned in the above link so can this argument be passed to an applet?
    here is my jnlp file
    <pre>
    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="1.0+" codebase="" href="">
        <information>
            <title>Applet</title>
            <vendor>ARTMS</vendor>
        </information>
        <resources>
            <j2se version="1.7+"  java-vm-args="-Djava.security.debug=sunpkcs11,pkcs11"/>
            <jar href="dsapplet.jar"/>
        </resources>
        <property name="java.security.debug" value="sunpkcs11,pkcs11"/>
        <applet-desc
             name="Applet"
             main-class="com.service.TestApplet"
             width="900"
             height="300">
                 <param name="java_arguments" value="-Djava.security.debug=sunpkcs11,pkcs11"/>
         </applet-desc>
      <security>
      <all-permissions/>
      </security>
         <update check="background"/>
    </jnlp>
    </pre>

    I tried with java web start still the jvm argument is not applied , please advice can this argument  -Djava.security.debug=sunpkcs11,pkcs11    be applied to java web start ?

  • How to register Key fingerprint with JVM 1.4.2?

    Hi,
    We need to register RSA key fingerprint with JVM 1.4.2. Does anyone know about this how to go about it?
    Thanks,
    Asawari

    Hi,
    as far as I know there is no "official" API in 1.4.2 to do this (since 1.5 there are the Management APIs). But I had the same problem once and found a pretty easy solution: Put the "perf.jar" and "perfdata.jar" from the 1.4.2 jvmstat distribution into your classpath (I hope you can find the old download somewhere...).
    The following piece of code demostrates how to access the perfdata from the JVM (note: with new VMIdentifier(0) you access your own JVM, so running the little sample program without any argument (or argument "0") would introspect the own JVM).
    import com.sun.jvmstat.perfdata.monitor.local.*;
    import com.sun.jvmstat.monitor.*;
    import java.util.*;
    public class PerfDataReader {
        public PerfDataReader() {
        public void run(String[] args) {
        try {
          PerfDataBuffer perfDataBuffer = new PerfDataBuffer(new VMIdentifier((args.length == 0 ? "0" : args[0])));
          System.out.println("VmId="+perfDataBuffer.getLocalVmId());
          List l = perfDataBuffer.findByPattern(".*");
          for (int i=0; i<l.size(); i++) {
              Monitor m = (Monitor)l.get(i);
              System.out.println(m.getName()+" = "+m.getValue());
        } catch(Exception e) {
          e.printStackTrace();
        public static void main(String[] args) {
            PerfDataReader main = new PerfDataReader();
            main.run(args);
    }Hope this helps!
    Nick.

  • How can I get a single jar file with NetBeans?

    How can I get a single jar file with NetBeans?
    When I create the project I get these files:
    dist/lib/libreria1.jar
    dist/lib/libreria2.jar
    dist/software.jar
    The libraries that have been imported to create the project are in separate folders:
    libreria1/libreria1.jar
    libreria2/libreria2.jar
    libreria1, libreria2, dist folders are all located inside the project folder.
    I added the following code to the build.xml:
    <target name="-post-jar">
    <jar jarfile="dist/software.jar">
    <zipfileset src="${dist.jar}" excludes="META-INF/*" />
    <zipfileset src="dist/lib/libreria1.jar" excludes="META-INF/*" />
    <zipfileset src="dist/lib/libreria2.jar" excludes="META-INF/*" />
    <manifest>
    <attribute name="Main-Class" value="pacco.classeprincipale"/>
    </manifest>
    </jar>
    </target>
    Of course there is also the project folder:
    src/pacco/classeprincipale.form
    src/pacco/classeprincipale.java
    Can you tell me what is wrong? The error message I get is as follows:
    C:...\build.xml:75: Problem creating jar: archive is not a ZIP archive BUILD FAILED (total time: 2 seconds)

    This is not a NetBeans forum, it is a JDeveloper forum. You might want to try http://forums.netbeans.org/. I also saw your other question - try looking in the New to Java forum: New To Java

  • Why are my JVM arguments not taking effect

    Hi,
    I'm trying to set the  -Dweblogic.security.SSL.protocolVersion=TLS1 at the server level as well as application.
    For the application (Agile PLM), I added the above into the Arguments section in the Console UI and I can see the change in the config.xml but I can still connect to .../Agile  using nothing SSL3 when I set my browser to use it only. I know my browser works OK because I changed our Atlassian product and it gives me errors with just SSL3.0.
    I'm also trying to set the set setting at the server level because I believe that the LDAP SSL error that I'm getting is due to the Domain Controller no longer accepting SSL 3.0 but I tried changed SetDomainEnv.cmd and SetEnv.cmd and neither would work as I can still get the /Console page.
    I'm on Windows 2008R2, WLS 12.c Agile 9.3.4
    in every case, I shut down WLS and restarted it.
    What is the correct file for WLS12.c on Windows to set the JVM arguments as I find answers to update different files or use WLST which I haven't used it yet but I should be able to just update the correct file and get the Protocol enforced?
    The command that I added to my two files:
    on SetDomainEnv.cmd:
    set JAVA_OPTIONS= -Dweblogic.security.SSL.protocolVersion=TLS1 %JAVA_OPTIONS%
    on SetEnv.cmd:
    SET JAVA_OPTIONS_WIN=-Dweblogic.security.SSL.protocolVersion=TLS1   
    Thanks
    Anatole

    Connect your device to a computer's itunes - that's the most reliable way to copy photos.  You should be doing this anyway, otherwise if the device craps out, you may end up losing all your photos.  Even if you have backup to icloud turned on - many users have discovered that a restore didn't return their pictures.
    As for photo stream...
    Check the following:
    From your Home screen, tap Settings > iCloud > Photo Stream, and make sure the slider is set to the ON position.
    From the Home screen, tap Settings > Wi-Fi, make sure the slider is set to ON, and that your device is connected to a wireless network.
    Ensure that Camera app is closed on the device where you took the photo. Photo Stream will not upload photos from an iOS device until the Camera app is closed.
    Ensure your iOS device has not fallen below 20% battery power. To preserve battery life, Photo Stream downloading and uploading are disabled when the battery reaches this threshold. Downloading and uploading will resume once you charge your device, and the battery charge is greater than 20%.

  • Jar: Manifest-Attribute "Class-Path"

    I've got a problem with the Class-Path-attribute of the JARs manifest-file. So I've written a real simple application to test where the problems occure... but even this trivial app does not work!
    The execution starts at "Starter.java":
    public class Starter{
          public static void main(String args[]){
                packageOne.Caller.callWriter();
    }The class "Caller" is in a JAR ("Caller.jar") in the same directory as Starter.java.
    Caller.java:
    package packageOne;
    public class Caller{
          public static void callWriter(){
                packageTwo.Writer.write("Write this");
    }The class "Writer" is in a JAR ("Writer.jar") in the same directory as Starter.java and Caller.jar.
    Writer.java:
    package packageTwo;
    public class Writer{
          public static void write(String message){
                System.out.println(message);
    }The file Caller.jar consists of Caller.class and the Manifest.mf. The package-structur/the path seams to be all right.
    The file Writer.jar consists of Writer.class and the Manifest.mf. The package-structur/the path seams to be all right.
    If I invoke the Starter with:
    java Starter -classpath Caller.jar;Writer.jareverything's fine.
    Now, I added the following line to the Manifest.mf of Caller.jar:
    Class-Path: Writer.jar(with one empty line between Manifest-Version: 1.0 and the new line.
    So... shouldn't it be possible now, to invoke the application with:
    java Starter -classpath Caller.jar ???
    It doesn't work. So: what have I misunderstood?
    (The error message is:
    Exception in thread "main" java.lang.NoClassDefFoundError: packageTwo/Writer
          at packageOne.Caller.callWriter(packageOne/Caller.java:5)
          at Starter.main(Starter.java:3)

    Hmmm, I tested it and here are the command I ran and their results. Try doing the same on your computer:aleph% mkdir packageOne
    aleph% mkdir packageTwoThat created the directories.aleph% cat > Starter.java
    public class Starter{
          public static void main(String args[]){
                packageOne.Caller.callWriter();
    aleph% cat > packageOne/Caller.java
    package packageOne;
    public class Caller{
          public static void callWriter(){
                packageTwo.Writer.write("Write this");
    aleph% cat > packageTwo/Writer.java
    package packageTwo;
    public class Writer{
          public static void write(String message){
                System.out.println(message);
    }That created the source files: Starter.java in the current directory, Caller.java under packageOne and Writer.java under packageTwo. Next the compiling and creating the manifest file:aleph% javac Starter.java
    aleph% cat > MF
    Class-Path: Writer.jarThat created additional info to be included in manifest file and put it in a file called MF.
    Then I package "caller.jar" with the manifest and "Writer.jar" without it:aleph% jar -cmf MF caller.jar packageOne
    aleph% jar -cf Writer.jar packageTwoDelete the package* directories so java wont get confused...aleph% rm -r package*And finally run the thing. Remember that the path separator is : in unix but ; in DOS, if that is what you are using.aleph% java -cp .:caller.jar Starter
    Write thisNo problems anywhere. What are the steps you did?

  • Classloader isolation and jar manifest Class-Path headers

    I have a system where I am loading a set of jars, each with its own URL classloader. So, Jar a is loaded by Loader A, jar b is loaded by Loader B, and so on.
    Each jar has a Manifest Class-Path entry declaring its dependence on other jars. So in the example above, a puts c.jar in its Class-path, and, let's say, b also puts c.jar in its Class-path, unbeknownst to a.
    Let's say there's a class Foo in c.jar. I want--need--it to be the case that (loader of a.jar == Foo.class.getClassLoader()) from the perspective of classes found in a.jar, and (loader of b.jar == Foo.class.getClassLoader()) from the perspective of classes found in b.jar.
    That is, I want a and b to have their own isolated "copies" of c.jar.
    Instead, what I'm finding is that Foo.class is loaded once, and his loader "leaks" over to the other jar's loader, if that makes any sense.
    Is there any way to accomplish what I am talking about here?
    Laird

    As I understand the question - no.Hi; I think you misunderstand the question.
    The classes are being loaded by the system loader.
    Thus there is no way to seperate them.
    If you want them seperate then you must use an
    explicit class loader to load them.I am using explicit loaders to load them. Let me try again, because I don't think I was clear.
    I have an application that has, let's say, nothing at all in its classpath. That is, it was invoked via "java ApplicationMainClass". No classpath.
    Now that application reads, let's say, a properties file containing a list of URLs that point to jars.
    Now the application creates a new URLClassLoader for each such URL. So if the mythical properties file has ten lines, then I create ten classloaders, each of which points to one and only one URL.
    My problem is, even classes loaded by these isolated, separate classloaders are "leaking" across to other loaders. Remember, the parent classloader of all of these classloaders can't see the jars. Its classpath was empty, remember?
    The issue is that the findLoadedClass() method of java.lang.ClassLoader scans the whole VM to see if a given Class was loaded before, and if it was, then by default that Class is simply returned. But I don't want that behavior.
    Now, I also don't want the behavior of having to load the silly things off disk each and every time. So how do I retain this true multiple classloader isolation?
    Thanks,
    Laird

  • Packaging  jar  file with classes

    Hi experts,
    I want to clarify a problem in relation with packaging .class files in jar file making
    it jar executable.I was able to achieve this when number of classes are limited and confined to only a single program.However recently i developed a software
    which is very much like SQL*Plus and retriee my company database using screen buffer management and i have handled almost all the issues.
    But so long to execute this program i am typing
    java <Program name>.It is using Oracle as backend.
    I tried to package Oracle driver files in jar using
    jar -cmf manifest.mf sqlpad.jar *.class Oracle\
    where Oracle directory contains all the class files in separate folders like
    Oracle\javax etc
    I get a jar file with hefty MBs size.It is executable too.But when i try to connect to
    database, i get message Oracle driver class is not found.
    In what way should i package it as jar file ?

    I wouldn't add the drivers to the JAR itself. Instead, I'd suggest one of the following:
    1.) Add classpath entries into your manifest file pointing to the drivers' JARs
    2.) Create a batch file for starting that contains a call to "java -classpath ..."
    3.) Add some way to your app to configure additional classpaths at runtime and use a URLClasssLoader (and a wrapper class for the driver for registering with the DriverManager) that loads the driver's class

  • Start weblogic server with java argument

    Hello,
    I am using weblogic server version 10.2. And the environment have one Admin server and two machines.
    In admin console, one managed sever is configured with Java argument in "Server Start". The java option can be passed to JVM when i start the managed server in admin console. i confirmed that by execute ps the java process from the linux server. However, the java argument cannot pass to the JVM when i start from command line as below. is there any specific configuration required?
    /weblogic/bea102/wlserver_10.0/common/bin/wlscontrol.sh -d premium_102_internet_qa -n /weblogic/ndmgr -c -f startManagedWebLogic.sh -s server_qa_svra START
    PLease help!
    Thanks,
    Angus

    You have to use the nodemanager. The parameters are added to a file startup.properties, located in the
    directory: <middleware-home>/user_projects/domains/<domain-name>/servers/<server-name>/data/nodemanager
    The file startup.properties is used by the nodemanager to start your managed server.
    You can start your environment by using a start script (written using WLST), for example,
    beahome = '<middleware-hoem>';
    adminusername = 'username';
    adminpassword = 'password';
    domainname = 'domain-name';
    linux = true;
    pathseparator = '/';
    if not linux:
         pathseparator = '\\';
    domainlocation = beahome + pathseparator + 'user_projects' + pathseparator + 'domains' + pathseparator + domainname;
    nodemanagerhomelocation = beahome + pathseparator + 'wlserver_10.3' + pathseparator + 'common' + pathseparator + 'nodemanager';
    print 'START NODE MANAGER';
    startNodeManager(verbose='true', NodeManagerHome=nodemanagerhomelocation, ListenPort='5556', ListenAddress='localhost');
    print 'CONNECT TO NODE MANAGER';
    nmConnect(adminusername, adminpassword, 'localhost', '5556', domainname, domainlocation, 'ssl');
    print 'START ADMIN SERVER';
    nmStart('AdminServer');
    nmServerStatus('AdminServer');
    print 'CONNECT TO ADMIN SERVER';
    connect(adminusername, adminpassword);
    print 'START MANAGED SERVER';
    start('ServerName','Server');
    nmServerStatus('ServerName');

  • How do you create a jar file with txt and classes?

    Hey, I'm trying to create code to create a jar file with a text file, but I can't figure out how to add the text file. Here is what I have so far:
    try {
                // Name of jar file to write
                String archiveFile = "test.jar";
                Manifest jman = new Manifest();
                try {
                    // Create a manifest from a file
                    //InputStream fis = new FileInputStream("manifestfile");
                    //Manifest manifest = new Manifest(fis);
                    // Construct a string version of a manifest
                    StringBuffer sbuf = new StringBuffer();
                    sbuf.append("Manifest-Version: 1.0\n");
                    sbuf.append("Ant-Version: Apache Ant 1.7.1\n");
                    sbuf.append("Created-By: 1.5.0_19-137 (Apple Inc.)\n");
                    sbuf.append("Main-Class: Main\n");
                    sbuf.append("Class-Path: lib/swing-layout-1.0.3.jar\n");
                    sbuf.append("X-COMMENT: Main-Class will be added automatically by build\n");
                    // Convert the string to a input stream
                    InputStream is = new ByteArrayInputStream(sbuf.toString().getBytes("UTF-8"));
                    // Create the manifest
                    jman = new Manifest(is);
                } catch (IOException e) {
                FileOutputStream stream = new FileOutputStream(archiveFile, true);// archive file is jar file name
                JarOutputStream out = new JarOutputStream(stream, jman);
                out.putNextEntry(new JarEntry("test.txt"));
                out.closeEntry();
                out.close();
            } catch (Exception ex) {
            }It creates the .jar file with the correct manifest but I can't get it to write the test.txt or anything else into the jar file.
    -Gandolf
    Edited by: GanMatt on Jun 18, 2009 8:18 AM
    Edited by: GanMatt on Jun 18, 2009 8:19 AM

    Alright, my question has changed. Here's the code:
    try {
                // Name of jar file to write
                String archiveFile = "test.jar";
                Manifest jman = new Manifest();
                try {
                    // Create a manifest from a file
                    //InputStream fis = new FileInputStream("manifestfile");
                    //Manifest manifest = new Manifest(fis);
                    // Construct a string version of a manifest
                    StringBuffer sbuf = new StringBuffer();
                    sbuf.append("Manifest-Version: 1.0\n");
                    sbuf.append("Ant-Version: Apache Ant 1.7.1\n");
                    sbuf.append("Created-By: 1.5.0_19-137 (Apple Inc.)\n");
                    sbuf.append("Main-Class: Main\n");
                    sbuf.append("Class-Path: lib/swing-layout-1.0.3.jar\n");
                    sbuf.append("X-COMMENT: Main-Class will be added automatically by build\n");
                    // Convert the string to a input stream
                    InputStream is = new ByteArrayInputStream(sbuf.toString().getBytes("UTF-8"));
                    // Create the manifest
                    jman = new Manifest(is);
                } catch (IOException e) {
                FileOutputStream stream = new FileOutputStream(archiveFile, true);// archive file is jar file name
                JarOutputStream out = new JarOutputStream(stream, jman);
                out.putNextEntry(new JarEntry("test.txt"));
                out.write("Hi".getBytes());
                out.flush();
                out.closeEntry();
                out.close();
            } catch (Exception ex) {
                JOptionPane.showMessageDialog(this,ex.toString(),"BUG!",JOptionPane.INFORMATION_MESSAGE);
            }It creates the jar file with the txt file inside it, but I can't write "Hi" inside of the text file. Any ideas?
    -Gandolf

  • Problems with passing arguments to app

    Hi.
    I have a litle problem with passing arguments. I create a dynamic jnlp file using jsp. This is my code:
    <%
    response.setContentType("application/x-java-jnlp-file");
    String l = request.getParameter("login");
    String p = request.getParameter("pass");
    out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
    out.println("<jnlp spec=\"1.0+\" codebase=\"http://212.244.104.27:8080/PzP_INSTALL/\" href=\"pzp.jsp\">");
    out.println("<information>");
    out.println("<title>xxx</title>");
    out.println("<vendor>xxxx</vendor>");
    out.println("<homepage href=\"main.jsp\"/>");
    out.println("<description>text</description>");
    out.println("<offline-allowed/>");
    out.println("</information>");
    out.println("<security>");
    out.println("<all-permissions/>");
    out.println("</security>");
    out.println("<resources>");
    out.println("<j2se version=\"1.4+\"/>");
    out.println("<jar href=\"jars/pzp.jar\" main=\"true\" download=\"eager\"/>");
    out.println("<jar href=\"jars/config.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"jars/commons-beanutils.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"jars/commons-collections.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"jars/commons-digester.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"jars/commons-logging.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"jars/commons-validator.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"jars/easclient.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"jars/easj2ee.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"jars/jakarta-oro-2.0.7.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"jars/jbcl.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"jars/log4j-1.2.7.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"jars/jdom.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"jars/xercesImpl.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<property name =\"javaws.login \"  " + "value=" + "\"" + l + "\"" + "/>");
    out.println("<property name =\"javaws.pass \"  " + "value=" + "\"" + p + "\"" + "/>");
    out.println("</resources>");
    out.println("<application-desc main-class=\"aaa.bbb.ccc.MyClass\"/>");
    out.println("</jnlp>");
    %>My problem is when i have the href tag filled, the arguments that i passed equlas null, when i remove the href everything is ok besides that the app doesnt show in application manager and doesnt create an icon on the desktop.
    out.println("<jnlp spec=\"1.0+\" codebase=\"http://62.89.104.27:8080/PzP_INSTALL/\" href=\"pzp.jsp\">");
    Any help would be appreciated.

    Hello again.
    Thanks for your replay but unfortunetly it doesnt work too :-(
    I've tried to use the out.println statemants in the servlet instead of using a jsp page but the error is the same. Please look at my code and tell me if you can what could be wrong.
    This is the error message:
    An error occurred while launching/running the application.
    Title: PZP
    Vendor: SPEED
    Category: Download Error
    Unable to load resource: http://212.89.104.27:8080/PzP_INSTALL/ServletPZP
    Servlet code.
    package pzp_install;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import pzp_install.LoginBean;
    import javax.swing.JOptionPane;
    public class ServletPZP extends HttpServlet {
      public void init(ServletConfig config) throws ServletException {
      super.init(config);
      config.getServletContext().setAttribute("ServletPZP", this);
      public void doPost(HttpServletRequest request, HttpServletResponse resp)
      throws IOException {
      PrintWriter out = resp.getWriter();
    // Get the value of the request parameter
      String login = request.getParameter("login");
      String pass = request.getParameter("pass");
    resp.setContentType("application/x-java-jnlp-file");
    out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
    out.println("<jnlp spec=\"1.0+\" codebase=\"http://212.89.104.27:8080/PzP_INSTALL/\" href=\"/servletpzp\">");
    out.println("<information>");
    out.println("<title>PZP</title>");
    out.println("<vendor>SPEED</vendor>");
    out.println("<homepage href=\"main.jsp\"/>");
    out.println("<description>Aplikacja wspomagajaca zarzadzanie zleceniami</description>");
    out.println("<offline-allowed/>");
    out.println("</information>");
    out.println("<security>");
    out.println("<all-permissions/>");
    out.println("</security>");
    out.println("<resources>");
    out.println("<j2se version=\"1.4+\"/>");
    out.println("<jar href=\"pzp.jar\" main=\"true\" download=\"eager\"/>");
    out.println("<jar href=\"config.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"commons-beanutils.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"commons-collections.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"commons-digester.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"commons-logging.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"commons-validator.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"easclient.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"easj2ee.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"jakarta-oro-2.0.7.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"jbcl.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"log4j-1.2.7.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"jdom.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<jar href=\"xercesImpl.jar\" main=\"false\" download=\"eager\"/>");
    out.println("<property name =\"javaws.login \"  " + "value=" + "\"" + login + "\"" + "/>");
    out.println("<property name =\"javaws.pass \"  " + "value=" + "\"" + pass + "\"" + "/>");
    out.println("</resources>");
    out.println("<application-desc main-class=\"pl.speednet.pzp.PzP\"/>");
    out.println("</jnlp>");
      public void destroy() {
      super.destroy();
    This is the brief of code which starts the servlet
    <form action="http://212.89.104.27:8080/PzP_INSTALL/servletpzp" method="post">
      <input type="hide" name="login" value=<%=l%>>
      <input type="hide" name="pass" value=<%=p%>>
      <input type=submit value=Start PZP>
    </form>
    This is the web.xml file code.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
      <servlet>
        <servlet-name>ServletPZP</servlet-name>
        <servlet-class>pzp_install.ServletPZP</servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>ServletPZP</servlet-name>
        <url-pattern>/servletpzp</url-pattern>
      </servlet-mapping>
      <mime-mapping>
        <extension>jar</extension>
        <mime-type>application/x-java-archive</mime-type>
      </mime-mapping>
      <mime-mapping>
        <extension>jnlp</extension>
        <mime-type>application/x-java-jnlp-file</mime-type>
      </mime-mapping>
    </web-app>

Maybe you are looking for

  • Job scheduling and printing

    main logic is that - when i wil execute  main program then whatever output wil cme that time one text file has to b generate. i want to do a program in which i have to use dynamic internal table and GUI_DOWNLOAD . and this program i want to submit in

  • Using a Mac on windows network with a proxy server

    Hi I'm very new to Macs to apologies if this is a really silly question. I'm trying to setup a Mac on our network and I'm having an issue getting it to work properly with our proxy server. I have connected the Mac to the network and selected automati

  • Old firewire hard drive and iMac

    I bought a used iMac G4 1ghz and wanted to transfer the files from my dead iBook that I had backed up to a Buslink MFW20 firewire drive. I hooked it up and expected it to just work, but nothing appeared. I checked the cable, it was fine. I shut down,

  • Probleme de freeze,ecran strillé qui se décale.

    Bonjour a tous, voila j'ai un probleme depuis environ 1 mois avec mon macbook pro 15" 2ghz acheté en aout 2011, l'écran se fige brutalement, l'image se decalle a l'écran et il fait plein de trait puis j'ai le message comme quoi je doit redemarrer le

  • The problem of return value from a method

    Hi everyone: I want return a value from following method. The basic idea is that I want use Num as a parameter to get a value from a field, therefore I can input this value into another database for the display purpose by using other classes. However