How to make jar executable?

I am distributing jar file to the user, which is executed using a batch file.In the batch file following things are done:
1. Setting the sytem variables
2. lauching the jar file
I want to avoid the usage of batch file as it is not safe.
Is there any way to launch the jar file as an executable along with the system variables set?

I am distributing jar file to the user, which is
executed using a batch file.In the batch file
following things are done:
1. Setting the sytem variables
2. lauching the jar file
I want to avoid the usage of batch file as it is not
safe.
Is there any way to launch the jar file as an
executable along with the system variables set?No, that can't be done. Do you really need the system variables? What are they used for?
Kaj

Similar Messages

  • How to make Jar files in JBuilder

    I would like to know how to make jar files using JBulider. I have a problem with a project that I am working with in Swing. I have made the project on JBuilder and when I make a jar file it will not run upon clicking.
    Any body with an answer, please help
    Abhi

    It sounds like your Main-Class is not set properly in your manifest. To set your Main-Class, please follow these directions:
    http://java.sun.com/docs/books/tutorial/jar/basics/run.html

  • How to make jar files availabe for deployed EJBs

    Hi,
    I'm interested on how to make jar files availabe for deployed EJBs.
    My EJB is packed in an ear. It uses a util jar. I now just add the jar to the
    classpath, but I think that shouldn't be the way. Is there somthing in the admin
    console to make jars available or do I have to insert it in the ear file? And
    if so, where do I hve to place it?
    Thanks
    Claudia

    Put the util.jar in the ear with your ejb jars - at the same level (i.e. in
    the root) - but do not include them in the manifest.xml.
    Also each ejb jar that refers to util.jar must have util.jar on its internal
    classpath in the manifest.
    "Claudia" <[email protected]> wrote in message
    news:3d537db5$[email protected]..
    >
    Hi,
    I'm interested on how to make jar files availabe for deployed EJBs.
    My EJB is packed in an ear. It uses a util jar. I now just add the jar tothe
    classpath, but I think that shouldn't be the way. Is there somthing in theadmin
    console to make jars available or do I have to insert it in the ear file?And
    if so, where do I hve to place it?
    Thanks
    Claudia

  • How to make my Execute Immediate statement to work??

    Hi, Sir:
    I use SQL Oracle 9i,
    I have following procedure called by a trigger:
    CREATE OR REPLACE PROCEDURE emps_check IS
    s_sql VARCHAR2(500);
    BEGIN
    DBMS_OUTPUT.PUT_LINE('1. Start to Delete all rows in the emps' );
    delete from emps;
    DBMS_OUTPUT.PUT_LINE('2. Start to insert into emps from emp' );
    s_sql:='INSERT INTO Emps(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) select EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO from emp;';
    DBMS_OUTPUT.PUT_LINE('3. s_sql= ' || s_sql );
    EXECUTE IMMEDIATE s_sql;
    DBMS_OUTPUT.PUT_LINE('3. Procedure call OK, Employ Name ' );
    EXCEPTION
    -- Use this to trap the ORA-00942: table or view does not exist
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('Procedure call Exception: Employ Name ' );
    end emps_check;
    My trigger is:
    CREATE OR REPLACE TRIGGER emps_biu_after
    after INSERT OR UPDATE or delete on emp
    for each row
    begin
    if TO_CHAR(SYSDate,'DY')= 'SUN'
    then
    DBMS_OUTPUT.PUT_LINE('Today is holiday, ename =' );
    else
    DBMS_OUTPUT.PUT_LINE('Today is working Day, ename =');
    emps_check();
    end if;
    end;
    When I use following to update emp table:
    SQL> UPDATE emp T1
    2 SET T1.sal = 200.0
    3 WHERE T1.ename like '%SCOTT%';
    I got:
    Today is working Day, Trigger Call Procedure emps_check()
    1. Start to Delete all rows in the emps
    2. Start to insert into emps from emp
    3. s_sql= INSERT INTO Emps(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) select EMPNO,ENAME,JOB,MGR
    Procedure call Exception: Employ Name
    Trigger Call Procedure emps_check() Success
    Looks like EXECUTE IMMEDIATE s_sql; did not work.
    What is wrong??
    How to make my Execute Immediate statement to work??
    Thanks

    You may omit the ';' character...
    s_sql:='INSERT INTO
    Emps(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO)
    select EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO
    from emp';
    ... and something else
    IN PL/SQL when a procedure , function doews not take
    any parameter(s) then its call can be made as simply
    its name without a pair of parenthesis....(It seems
    that you are influenced by Java...:) )
    SimThanks Sir:
    I remove this ; but still error:
    1 UPDATE emp T1
    2 SET T1.sal = 768.1
    3* wHERE T1.ename like '%SCOTT%'
    SQL> /
    Today is working Day, Trigger Call Procedure emps_check()
    1. Start to Delete all rows in the emps
    2. Start to insert into emps from emp
    3. s_sql= INSERT INTO Emps(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) select EMPNO,ENAME,JOB,MGR,
    Procedure call Exception: Employ Name
    Trigger Call Procedure emps_check() Success
    My code as follows:
    CREATE OR REPLACE PROCEDURE emps_check IS
    s_sql VARCHAR2(500);
    BEGIN
    DBMS_OUTPUT.PUT_LINE('1. Start to Delete all rows in the emps' );
    delete from emps;
    DBMS_OUTPUT.PUT_LINE('2. Start to insert into emps from emp' );
    s_sql:='INSERT INTO Emps(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) select EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO from emp';
    DBMS_OUTPUT.PUT_LINE('3. s_sql= ' || s_sql );
    EXECUTE IMMEDIATE s_sql;
    DBMS_OUTPUT.PUT_LINE('3. Procedure call OK, Employ Name ' );
    EXCEPTION
    -- Use this to trap the ORA-00942: table or view does not exist
    WHEN OTHERS THEN
    DBMS_OUTPUT.PUT_LINE('Procedure call Exception: Employ Name ' );
    end emps_check;
    what is other wrong??
    Yes, I am java guys,
    Thanks

  • How to make jar file for this compilation method ?

    can any one tell me how to make jar file for this compilation
    D:\java\browser\IEInJava>javac -classpath jdic.jar;. IEInJava.java
    D:\java\browser\IEInJava>java -cp jdic.jar;. IEInJava
    *this is a compile code:-*
    D:\java\browser\IEInJava>javac -classpath jdic.jar;. IEInJava.java
    *and this is a run code:-*
    D:\java\browser\IEInJava>java -cp jdic.jar;. IEInJavanow how make JAR file ?

    Assuming IEInJava only uses classes inside the jdic jar, this is one way. D:\java\browser\IEInJava> jar cf yourjar.jar IEInJava.classThen to run it you would use D:\java\browser\IEInJava> java -cp jdic.jar;yourjar.jar IEInJavaAnother way would use the jar manifest file to specify the Main-Class and Class-Path.

  • How to make jar files at runtime in a server application

    I am using Jung API and i need to load the class files in this JAR file for my application at runtime.
    I am using an applet which uses this API which is loaded with the help of a Servlet.
    The code is getting compiled but the JAR files and associated classes are not available at the runtime
    How to make themk avalable.
    I have tried various options like placing jar files in
    WEB-INF/lib
    $Catlina_Home/commons/lib
    But it is not working can anyone help me it is of high urgency to me
    How to make that classes in the JAR file available to my applet at runtime

    SuperJavaHello wrote:
    How to make that classes in the JAR file available to my applet at runtimeAhh! The runtime is an appler! The applet is on the Client, and the Client does not have access to the Server's classpath. You need to un-pack the JAR, then re-pack the classes into the JAR used to pack your Applet, the one that you are using as the code source in the applet tag.

  • How to make  jar with from java code for the filenames containing spaces

    I tried to make jar file using Runtime.exec method . The filenames have spaces in it .So i gave the filenames in double quotes.It works fine with windows and also from the command prompt.But when i run the same code in unix box , it creates a jar file with no content.Pls give some solution. I used the jdk1.2.2

    Pls give some solution. Pls post your code

  • How to make jar file?

    hi
    i want to make my jar file of my own package name "practise".
    can u help me in making jar file.
    what is the command to make jar file?
    expected name of jar--> runner
    package for which i want to make jar----> practise
    plz help me in this regard.
    i m very greatfull to your precious comments and suggestions.

    hi
    if u r creating first time means...
    jar cf filename.jar *.*
    u want to update jar
    jar uf filename.jar *.*
    extract
    jar xfv filename.jar
    (filename is ur package name)
    do this...
    .

  • How to make .jar files executable by double clicking

    hi,
    I've been trying to make my .jar file created via ANT Tool executable by double clicking it but I'm not being successfull. I looked at the ANT Tool for making manifest.mf and I included most of the attributes listed there and later found that Main-Class attribute is required but its not mentioned in the documentation.
    So, I'll be very greatful to receive any suggestions
    regards,
    Jay

    ya I've been doing things the same way mentioned there but it isn't working. here is the code for it:
    //All the .class files are in the build directory and the class files are under the package org.home.proj.
    <!-- For making .jar files -->
    <target name="jar" depends="compile" description="Makes CyberStation.jar from the CyberStation code.">
        <mkdir dir="${bin}" />
        <jar jarfile="${bin}/CyberStation.jar" basedir="${build}">
          <exclude name="**/run.bat" />
            <manifest>
           <attribute name="Buily-By" value="${user.name}" />
           <attribute name="Main-Class" value="org.home.proj.CyberSoft" />
             <section name="org/home/proj/CyberSoft.class">
               <attribute name="Sealed" value="false" />
             </section>
         </manifest>
        </jar>
      </target>It show the error: Could not find the main class. The program will exit.
    regards,
    Jay

  • How to make jar

    hi
    i have a folder name cdma in that i have classes and one folder named images.
    i use to get the image as follow
    JLabel label=new JLabel(new ImageIcon("images/abc.gif"))
    now i want to make the jar file which i put on the desk top and by double clicking the application run.
    i make Manifest file as
    Main Class: Mymain
    but i do not know how the image folder add in jar for getting the images from image folder.please help me with statements.
    thanks

    Just add it. A JAR is nothing but a zip file.
    Resources are loaded from JARs using Classloader's getResource("/images/abc.gif") or getResourceAsStream() methods.

  • How to make .jar file for a multiple class program

    I have a code for a chat room that contains two folders , one for Server and one for Client
    What I need is to create a jar file for the server and a jar file for the clients
    but here the first problem , I have a file that named (SocketMessengerConstants.class) that is located outside the two folders and is being read by the two projects .
    I mean the server uses it while running and the client uses it too .
    the second problem is : I don't know how to create a jar file at all !
    please tell me how to do it in detail
    Thank you

    ChuckBing wrote:[Packaging Programs in JAR Files|http://java.sun.com/docs/books/tutorial/deployment/jar/index.html]
    I tried to read this tutorials before I come here but I couldn't understand it
    can you please tell me a specific steps to follow instead of the explaining .. because I understand the explanation but I can't apply it

  • [SOLVED] Yeganesh - how to make it execute applications?

    I read about Yeganesh in the Wiki. Unfortunately there's not much written about it and I've probably read all a google search can give, but I still can't get it to work.
    I want to use dmenu + yeganesh in Awesome so the keybinding matter is a piece of cake. What I've done:
    - installed the whole kit dmenu + different haskell packages + yeganesh
    - first I tried plain dmenu and it works perfectly well
    - I ran "dmenu_path | yeganesh" which worked well
    - the above created the directory .yeganesh and first run created the file default within it (so far all good)
    Here starts the trouble, because according to the on-page yeganesh home-page it's enough to run "echo | yeganesh" the second time. Frankly I don't understand how this works and it does only produce yeganesh database of previous commands. Since I didn't get this I added the following line to my rc.lua for awesome:
    dmenu="dmenu= "dmenu_path | yeganesh -- -b -fn '-*-terminus-*-r-normal-*-*-120-*-*-*-*-iso8859-*' -nb '#000000' -nf '#FFFFFF' -sb '#0066ff'"
    which is run by standard procedure:
    table.insert(globalkeys, key({ modkey }, "d", function () awful.util.spawn(dmenu) end))
    This executes dmenu + yeganesh without issues, and the database gets updated and yeganesh shows previously "[not] executed command" but IT DOESN'T EXECUTE CHOSEN COMMANDS.
    I would appreciate help with this, since this combination is far better than dmenu by itself.
    EDIT: I leave my above "mistake" in case someone looks for answers since there so little to find about yeganesh. I did forget a $ and brackets. The correct line should have been:
    dmenu= "$(dmenu_path | yeganesh -- -b -fn '-*-terminus-*-r-normal-*-*-120-*-*-*-*-iso8859-*' -nb '#000000' -nf '#FFFFFF' -sb '#0066ff')"
    Last edited by KimTjik (2009-03-24 22:27:07)

    There's this udev trick:
    http://wiki.archlinux.org/index.php/Ude … SB_devices
    it looks like it will automaticly mount the device to /mnt/usbX . If that won't work you can always modify it to create a symlink from /mnt/usbX to /mnt/usb, or just mount any /dev/sdX to /mnt/usb .
    Happy Hacking

  • How to make jar file of application using JMF

    Hi
    i developed an application which uses JMF it works well during compilation and displays audio and video too.
    but after builting jar file it doesn't works.
    abdul

    Well you've found the root of your problem. It's not necessary the JMF. It's when you make a jar file, you need to include the dependencies. I don't think it' legal to include the JMF in a program you sell or distribute, so be careful there.
    However, to include dependencies in jar files is not a hard task. The simplest method is to unjar the dependency and place it at the top or your classpath; then make a jar that includes both your program, and the dependency.
    A more long term solution is to use a build system such as ant or maven to create the package using available scripts or plugins. The "Uberjar" plugin for maven comes to mind.
    -vito

  • How to make jar file of a groups of directory?

    For examle,
    I have a directory call firstDir,
    which include secondDirA, secondDirB,
    and both secondDirA and secondDirB have some .class files
    and want to make a jar file named "example.jar"
    Thanks~

    This is from the jar manual:
    If any file is a directory then it is processed recursively.
    jar -cf example.jar *should do the required task

  • 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.

Maybe you are looking for

  • Importing XML. Not working for me.

    I've watched the InDesign/XML video now three or four times and I've tried to follow its steps diligently. But, I'm not having success. I created an InDesign template with all of the xml placeholder items in place. The structure at the left side of t

  • Swing popup to close after X seconds

    How to show an another window (a popup or something) in main swing window which will close after about 10 seconds?

  • IMic - very noisy recording

    Hello, I've bought the Griffin iMic to get an input jack on my iBook G4. Once it's connected directly on one USB of the iBook, with GarangeBand or any other software that can record sound, the result is very noisy. It sounds like a Ground problem cau

  • Flex3 and cocomo?

    I want to know if Cocomo work with Flex 3 or Flex 4? Thanks Mark

  • Standalone Java component for AQ

    Hi, 1.How to connect with Oracle AQ with standalone java component with Sun JMS specification (javax.jms.*) and without using oracle.aq.*, oracle.jms.* 2.is it possible to connect Oracle AQ without server interraction? 3. if possible, where can i cre