Java executables and jar files

I'm new to Java and recently completed a Java training class that involved the creation of a cutomer service application in Microsoft Visual J++. The application ran fine in debug mode. However, no mention was made of how this would be run on a machine without an development tool as J++. How is this done? Can Java programs be compiled into .exe's like C, C++,, abd Visual basic programs? If not, how are the classes called to make use of their code?
Also, what is a .jar file and how is it used?

You went to a class and they didn't teach you the answers to these questions? I say go and get your money back: you we're ripped off.
1) Yes you can turn your java code into an .exe but that would be pointless as java was designed to be "platform independant" and this violates that principle.
2) jar files are zip files for all intents and purposes. They contain your 'compiled' java byte code.
3) Microsoft does not support J++ nor does it ship java with its browser anymore so I suggest you download java from this website and use the real thing.

Similar Messages

  • How to execute a jar file in a java application

    Hi,
    I've already try to execute a jar file by this way :
    Runtime.getRuntime().exec(java -jar myJarFile.jar);
    But the problem is that the display doesn't launch. Normally a "JFrame" display.
    however the corresponding process is launched.
    So i would to know if there is a way to execute a Jar File without using the Runtime class.
    Is there a specific class for the Jar File?
    Thank you.
    Richard

    Create a 'manifest' file pointing to the 'main' class, jar it into the .jar file, place it onto your desktop - or whereever you can click on it, and click on it.

  • How to execute a jar file in other machine?

    Hi all,
    I am working with java. and my machine is connected to LAN.I would like to execute a jar file in my machine from a remote machine that is also connected to LAN.how should i go about doing this.Help me if somebody have a solution as i am badly in need of this.
    Regards,
    Mohan

    Hi Mohan.tkm,
    If you want it to be done in pure Java and independently of the OS of both computers, you may build a RMI server that will launch your JAR by request of a remote RMI client.
    There's an example of RMI here .

  • Exception is thrown only while executing the jar file

    java.lang.NoClassDefFoundError: javax/mail/Address Exception is thrown only while executing the jar file. But the program compiles and executes good when executed for command prompt through the class files.
    I used javamail API in my program. Classpath and every others are set to the right one's. Executed fine when used java Random.class. But the problem is only with the jar file.
    Please help me out in this regard. Why the exception is thrown only in jar but not at class level.

    Assuming you're running your program using "java -jar", your jar file needs a Class-Path entry
    in the manifest file that references mail.jar.

  • Unix Script and Jar files

    I am in the process of designing a new system and wonder if the following is possible.
    I want a UNIX script to execute a Jar file with a status of 1 or 0 (based of success/failure) being passed back from the Jar to the UNIX script.
    I know a Jar file can be executed from a UNIX script but not sure about the passing of a message.
    Would public static void main(String[] args) make it impossible to pass a message or is there some way around this ?
    If a message can be passed back to the Script how would it pick it up ? - `echo $?` ?
    Message was edited by:
    palmeal

    Right, in the shell script you have in $? the return
    code of the last command.
    java ...
    if test $? -eq 0
    then
    echo java was ok
    e
    echo java oops
    If a message can be passed back to the Script howwo
    However the return code is no message.I really don't understand! Are you saying you just want to read something in the shell script that is generated by the Java program but the Java program must keep running and not terminate? If so then use stdout or stderr (as BIJ001 says).

  • How to execute a jar file which has an applet, without using a html file ?

    I have a jar file which contains a set of class files. iam able to execute the jar file by using this html code
    <html>
    <applet code="file.class" archive="file.jar" width="500" height="300">
    <param name="name" value="value">
    </applet>
    </html>
    I want to know how to execute this class file without using the html tags.
    pls help me out in this.
    Anki

    Hi,
    You can make an executable jar file such that when you double click on that it starts running. Just follow the steps.
    1. Open a notepad and write the following
    Main-Class: XXXXXXXX
    XXXXXXX means Your Main Class name. Don't forget to press Enter after you write your class name.
    2. Save the file as Mani.mf
    3. In the commant prompt ( your directory ) type following lines.
    jar cmf Mani.mf Demo.jar *.*
    4. This will make a jar file which is executable jar file
    Hope this will help you.
    Deepak

  • Are JDev autogenerated paths needed to create ear, war and jar files ?

    Hi
    We want to create ear, war and jar files from Ant build script generated from JDeveloper 11.1.1.7.
    We also like to use ojdeploy with it.
    In the process of creating build.xml files from projects, we see these paths.
    We also have standalone Weblogic installed with ADF runtime 11.1.1.7
    Questions:
    1- Do we need these path ids to generate ear, jar, war files properly and then deploy the ear to our standalone Weblogic so that our webapp can run ok ?
    2- Why are they generated, if they are not needed
    From research, it appears that we don't need these paths except to keep ant targets of init, compile, exec etc with ojdeploy.
    3- Is that true ?
    We are afraid that because no paths are listed in the build.xml, then when we deploy the ear app, it cant use the ADF runtime on the standalone WLS.
    Thanks in advance for answering.
    Sincerely
    eg of paths generated below:
      <path id="library.SOA.Designtime"/>
      <path id="library.SOA.Runtime"/>
      <path id="library.BPEL.Runtime"/>
      <path id="library.Mediator.Runtime"/>
      <path id="library.MDS.Runtime">
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.mds_11.1.1/mdsrt.jar"/>
      </path>
      <path id="library.BC4J.Service.Runtime">
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.adf.model_11.1.1/adfbcsvc.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.adf.model_11.1.1/adfbcsvc-share.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/commonj.sdo_2.1.0.jar"/>
        <pathelement location="{oracle.middleware}/modules/org.eclipse.persistence_1.1.0.0_2-1.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.webservices_11.1.1/wsclient.jar"/>
        <pathelement location="{oracle.middleware}/oracle_common/modules/oracle.web-common_11.1.1.jar"/>
      </path>
      <path id="library.TopLink">
        <pathelement location="{oracle.middleware}/modules/com.oracle.toplink_1.0.0.0_11-1-1-5-0.jar"/>
        <pathelement location="{oracle.middleware}/modules/org.eclipse.persistence_1.1.0.0_2-1.jar"/>
        <pathelement location="{oracle.middleware}/modules/com.bea.core.antlr.runtime_2.7.7.jar"/>
        <pathelement location="{oracle.middleware}/modules/javax.persistence_1.0.0.0_2-0-0.jar"/>
      </path>
      <path id="library.Oracle.Rules"/>
      <path id="classpath">
        <path refid="library.SOA.Designtime"/>
        <path refid="library.SOA.Runtime"/>
        <path refid="library.BPEL.Runtime"/>
        <path refid="library.Mediator.Runtime"/>
        <path refid="library.MDS.Runtime"/>
        <path refid="library.BC4J.Service.Runtime"/>
        <path refid="library.TopLink"/>
        <path refid="library.Oracle.Rules"/>
      </path>

    There are two different things here. Using ant to build the class files and then building an ear from the class files and other resources.
    The building part needs the libraries if you use javac as compiler. Building an ear file only needs the path to the jar files which are packed into the ear.
    In this sense you need the pages you see in the build.xml.
    Then Jdev offers another way: ojdeploy. This tool is a Jdev without a gui.
    You can use this tool and build the classes for each project of a workspace and to build build war and ear file. This is just like you click the rebuild button for each project and then the deploy the projects and application. If you use this approach you don't need the generated path ids as the whole build process is done inside Jdev as it's done on your developer pc.
    Timo

  • Where to put common classes and jar files

    hi,
    i want to put some classes and jar files in a common folder so that it can be accessed by other applications is there any way doing that.In tomcat server they have common and shared directories once any classes are into that folder they are being accessed easily ,but i am having problems with sun one .
    Regards
    Ameem Sami

    Did you find a solution for this? I'm having the same problem.
    Thanks,
    Tony

  • Convert executable and supporting files to msi

    Hello all,
    Wanting to know if it is possible, or if anyone has tried, to roll a labview executable and supporting files into a .msi microsoft installer package.  Wanting to do this for its auto exection and encryption.  I have attempted using third party applications like "Advanced Installer" and Altris wise package studio with no avail.  I found the following old post describing this exact problem using a different third party applicaiton and labview 6.1.  I am currently running Labview 2011 professional.
    http://forums.ni.com/t5/LabVIEW/Repackaging-Labview-using-Veritas-Wininstall-fails/td-p/89442
    I know that Lab-windows can be used to package a .msi installer but I do not have access to it nor am I trained to use it.
    Just wanting some information, any information, on how to make this happen.  

    When you built the exe in the project, you should have noticed the option to create an installer. Fully documented in the LabVIEW help.

  • Protecting jnlp and jar files

    Hi
    I would like to know how to protect the jnlp and jar files against anyone who just types the URL in the browser Address bar.
    Thanks
    Steven

    Haven't tried, but if your jnlp app must check for updates on every startup and your files (both jnlp file and jars) are in a password protected folder (using digest or plain authentication over a SSL connection, for example) then you may be in trouble. Will JWS recognize this situation on an update check and prompt for login/password? (related to web server's folders).
    Regards

  • [svn:bz-trunk] 19596: Add JGroups 2.11.0 GA source and jar files.

    Revision: 19596
    Revision: 19596
    Author:   [email protected]
    Date:     2011-01-05 08:35:22 -0800 (Wed, 05 Jan 2011)
    Log Message:
    Add JGroups 2.11.0 GA source and jar files.  It requires JDK 1.6.x and up.   Currently it can be only used for runtime and can't be used to build the BlazeDS source, which requires JDK 1.5.x.
    Modified Paths:
        blazeds/trunk/resources/clustering/readme.txt
    Added Paths:
        blazeds/trunk/lib/jgroups-2.11.0.GA.jar
        blazeds/trunk/resources/clustering/JGroups-2.11.0.GA.src.zip

    Revision: 19596
    Revision: 19596
    Author:   [email protected]
    Date:     2011-01-05 08:35:22 -0800 (Wed, 05 Jan 2011)
    Log Message:
    Add JGroups 2.11.0 GA source and jar files.  It requires JDK 1.6.x and up.   Currently it can be only used for runtime and can't be used to build the BlazeDS source, which requires JDK 1.5.x.
    Modified Paths:
        blazeds/trunk/resources/clustering/readme.txt
    Added Paths:
        blazeds/trunk/lib/jgroups-2.11.0.GA.jar
        blazeds/trunk/resources/clustering/JGroups-2.11.0.GA.src.zip

  • How to run .class file and .jar file in jdev9i

    I want to run .class file and .jar file in jdev9i,what should I do?
    Also,I want to generate .class file and .jar file in jdev9i,what should i do?

    Add the .class file containing the public static void main(...) method to the project by clicking on the + toolbar button in the navigator, open the project properties and properly set the additional classpath then right click on the .class in the navigator and say run. It should work, I've just tried it.
    Doesn't work for a .jar yet, in JDeveloper 9.0.3 it works both for .class and .jar
    Michel

  • Executing a jar file from an arbitrary folder

    I got a small problem in detemining the path of my application's jar file. I am starting the application by executing a batch, lets say MyApp.bat (using it on windows and unix), this batch file consists of one line 'java -jar MyApp.jar', MyApp.jar being in the same folder.
    Now lets say MyApp.bat and MyApp.jar are in folder 'A' and my current working directory is a parallel folder 'B', so I can invoke the batch file from there(!) by executing '../A/MyApp.bat'. But now the VM tries to find MyApp in the current working directory which is still 'B' and not 'A'. A simple solution would be to use a script which determines the directory of MyApp.jar and include the generated path in the call to the VM (I didn't try yet, but I guess this will awkward doing it on windows)
    Since I don't think I am the first person executing a java program via a script from an arbitrary folder in a file system, I hoped that there might be a more elegant way. Unfortunately I couldn't find another solution yet.
    Regards,
    Stefan

    In MyApp.bat your line should read (NT/2K/XP/2003/Vista):java -jar "%~dp0MyApp.jar"Regards

  • While executing a jar file I am getting an error

    while exec a jar file i am getting an error
    invalid file (bad magic number): Exec format error
    i tried to execute it with the commnad
    java -jar test.jar
    or by directly too
    ./test.jar

    Than tell me how to launch a jar file I tried different ways like
    java -jar MyJar.jar
    and
    MyJar
    and
    ./MyJar
    but its not worked

  • Question about classpath and jar file

    I have a jar file (actually jhall.jar, the java help jar file). How do I uses its classes if I don't want to add it to the classpath. Currently, I have the jar file in the same directory as all my other classes.

    it simply adds secondjar.jar into firstjar.jar, rather
    than extracting secondjar.jar's files and put it into
    firstjar.jar. How would I be able to do that?Don't do either of them. Distribute the two jar files separately, and in the manifest of the one which is meant to be your executable jar file, put a Class-Path: entry that refers to the other one. Look at the latter parts of the tutorial about jar files:
    http://java.sun.com/docs/books/tutorial/jar/basics/
    PC&#178;

Maybe you are looking for

  • Can I use officially unlocked iPhone in different countries?

    I'm moving to Rome with my job for eight months, then on to Chicago for four months, then back to London. I'm trying to find out if I buy an unlocked Pay as You Go iPhone in one of the various EU countries selling manufacturer unlocked units (France,

  • What is "sessionstore.js.tmp" and how can I get rid of it?

    It's been happening ever since July 31st. Any time I start or re-start Firefox, or when it crashes and I have to open it back up, it completely reverts to my Firefox session from July 31st, and not the current session. An attempt to delete from my Fi

  • Adding a KF from another Cube

    Hi Gurus,        I have requirement to add 2 Key Figures from one query of InfoProvider A to another query of a different InfoProvider B. Please guide me in designing the query. Thanks, S

  • Configure RVS4000 Behind 2700-Gateway Qwest DSL Router VPN

    I have my QWEST DSL Router 2700-Gateway using a static public IP address This is setup to be the DHCP and assigned 192.168.0.2-50 I need some help how to connect my RVS4000 and utilize VPN so I can connect to my work network from home. The 2700-Gatew

  • Help Me With Creating AutoRun CD Menu

    I'm rather new to flash, I know the basics, I can do all the graphics designs and buttons. I know how to make the menu autorun, if I had one. I just don't know how to make the buttons open an .exe or .pdf file when they're in the root directory with