Java Jar files, and what is needed to run them?

I'm sort of confused on what happens with JAR files, because on my computers that have all of the java SDK's and programs installed it works as an executable. But on my computer that doesn't have java installed(except for the windows xp basic) it wont work or registers with winRAR.
My question is, is what needs to be installed on the computer to get an executable jar file to work. Is it JRE, or the SDK? And where can I get the file/s that may be needed to be installed.
Thanks for the help

jre stands for java runtime environment, i.e. everything you need to run a java application on your computer.
sdk stands for software development kit, i.e. everything you need to develop java applications
the jre run jar files for sure

Similar Messages

  • Jar file and source code? (new to java!)

    Hi all!
    Sorry if this is a dumb question but I'm really new to java (.net guy).
    Someone sent me a jar file and now I need access to source code. I now that I can rename to .zip and view its contents (.class)...
    But what about source code? Can I decompile? As i understand, .class files are compiled .java files...
    Should I ask for the source code to the guys that sent me the .jar file?
    thanks
    jay

    Humm... is java as fast as replies in this forum? Thank's for your replies warnerja and zadok
    I need the source code so that I can understand how the original developer solved a problem. I can ask for the source code.
    I posted this message because I was afraid that the question was stupid and source code was in front of me. I am really new to java!
    So. No source code in .jar or .class files. Right?
    Thanks
    Jay

  • Traversing the Java Jar file

    Hi,
    This might sound like a weird question, but I need to traverse the Java Jar file and create respective Java objects into objects in some other language using reflection.
    Is it possible to find the path for the class files located in any jar file? Does Java supports traversing or reading and finding jar contents?
    Thanks

    I found a way to traverse the Jar, using java.util.zip, one can create a zip file for the given jar file and using ZipEntry it is possible to findout the properties associated with the jar/zip entries.

  • Help with running java .jar file

    Hi I just installed java with
    # pacman -S jre
    and when i try to run
    java -jar file.jar
    it says command not found. so what do i need to install to be able to run java .jar files through the CLI?

    do, what vintendo says. because it cant find the java in the default paths.

  • Opening a java jar file through a labview program

    Hello,
    I need to open a java jar file in labview........this jar file is a GUI with multiple frames and has buttons on each frame help navigate through between frames....i just require the program to open it and close it based on some signals so then i won't have to do it manually

    LabVIEW doesn't have any control over what happens in a system exec, as you give the control to the system. You can, however, check the process list through .NET commands and kill the process (You should be able to stop it through "taskkill /F /im java.exe"). Not the prettiest solution, but should work.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • Jar files and JApplet

    My applet class is using other classes in my package,
    So do i need to create a jar file and specify that jar file in <applet archieve = :myjar.jar"
    I did created the jar file , but its not loading up, the browser just says Loading java applet, what might be the reason, does it depends on size of jar file?
    or my tags are wrong.
    my applet tag is
    <html>
    <applet archive = "myjar.jar"
    code = "front.class"
    width.. >
    the front.class file is also in myjar.jar.
    Any help....
    Also one more question,
    Can i call other applets within one applet class.
    I have a gui, when a particular button is clicked on applet
    i want to go to other applet, so how should i call it in that buttons action listner?
    And in my applet class i am using one other class from my package which actually coonects to databse through JDBC. now say i have a button on my applet whihc says "Connect", and when that button is clicked then I created object of my other class which makes connection
    through databse. So will this work from applet?
    Thanks

    my applet tag is
    <html>
    <applet archive = "myjar.jar"
    code = "front.class"
    width.. >Just to get you started - if it is a JApplet, not an Applet, then you need to use different HTML tags, otherwise it won't work. If you have JDK1.3, look in the /bin directory - you should see a file called "HTMLConverter.bat" if it's there, cd to the directory where your HTML file is, and type
    "HTMLConverter wateverYourHTMLPageIsCalled.htm"
    (case sensitive - and remember to check whether its called ".htm" or ".html")
    When it has executed successfully, look at the source of your html - it should be different (<OBJECT> tags and lots of other stuff)
    If you have an older version of the JDK, or don't have HTMLConverter.bat, you can download it from Sun's website.
    Now you should be able to run your applet...
    >
    Can i call other applets within one applet class.
    If you use "getAppletContext().showDocument(URL url)", this will replace the current html page with the new one - is that what you mean?
    And in my applet class i am using one other class from my package which actually
    coonects to databse through JDBC. now say i have a button on my applet
    whihc says "Connect", and when that button is clicked then I created object
    of my other class which makes connectionthrough databse.
    So will this work from applet?Should do :-)

  • Jar files and applet

    My applet class is using other classes in my package,
    So do i need to create a jar file and specify that jar file in <applet archieve = :myjar.jar"
    I did created the jar file , but its not loading up, the browser just says Loading java applet, what might be the reason, does it depends on size of jar file?
    or my tags are wrong.
    my applet tag is
    <html>
    <applet archive = "myjar.jar"
    code = "front.class"
    width.. >
    the front.class file is also in myjar.jar.
    Any help....
    Also one more question,
    Can i call other applets within one applet class.
    I have a gui, when a particular button is clicked on applet
    i want to go to other applet, so how should i call it in that buttons action listner?
    And in my applet class i am using one other class from my package which actually coonects to databse through JDBC. now say i have a button on my applet whihc says "Connect", and when that button is clicked then I created object of my other class which makes connection
    through databse. So will this work from applet?
    Thanks

    You didn't show all of your applet tag, but it should look like this:
    <HTML>
    <APPLET CODE = front.class, ARCHIVE = myjar.jar, width = ???, height = ???>
    </APPLET>
    </HTML>
    Assuming your applet is not crashing, this should load it. I recommend using the appletviewer tool in the JDK, it provides more detailed error messages. I hope this works for you.
    Now inter-applet communication. This is forbidden, sorry. However, if you really want to get fancy; remember that all applets can communicate back to the host from which they came. So if you want to build a small server on your host machine which all your applets log into, they can then communicate with each other through the server.

  • Execution from JAR files and Classpaths -- Help

    I am confused about how classes are resolved when running from within a JAR file, and why this is different than running a class that is not inside a JAR file.
    I have an application that uses classes from a third party library stored in a JAR file (biojava.jar) . If I run the app from the class file it works as expected and is capable of finding the external classes when the path to the biojava.jar is on my classpath. It also works if biojava.jar is instead placed in the extensions folder jre/lib/ext folder without an explicit path entry in my classpath.
    However when I package all my application classes up in a JAR file and try to execute the application from the JAR file it will ONLY work if I add a manifest entry to myApp.jar ... Class-Path: biojava.jar AND I place the file biojava.jar in the SAME directory as the Packaged JAR application. I would like to find a way to make this JAR file work for anyone who has biojava.jar in their classpath or ext directory. In other words I don't want my user community to have to copy the biojava.jar file when I email them myApp.jar. This community will already have biojava.jar on their CLASSPATH.
    How can I make my app within a JAR recognize either the user's CLASSPATH or ext folder? I have tried reading the documentation and many experiments but the only way it works is as described above.
    I am running Running Windows 2000.
    java version "1.4.1_01"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
    Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)
    Here are the results of my experimentations:
    The following Works:
    Manifest: Main-Class: org/biojava/app/SequenceSpiral
    Manifest: Class-Path: biojava.jar
    Place biojava.jar in the same directory as SequenceSpiral.jar
    java -jar SequenceSpiral.jar
    This works perfectly
    NONE of the following work
    0) Placing biojava.jar in my jre/lib/ext directory instead of the same dir as SequenceSpiral.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/biojava/bio/seq/FeatureFilter
    (this is the first class referenced from biojava.jar)
    1) Just see if it will find the proper jar on my classpath
    Manifest: Main-Class: org/biojava/app/SequenceSpiral
    I have biojava.jar on my classpath but not in same directory as SequenceSprial.jar
    java -jar SequenceSpiral.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/biojava/bio/seq/FeatureFilter
    2) Specify the name if the jar in the Manifest Classpath and see if it will find the proper jar on my classpath
    Manifest: Main-Class: org/biojava/app/SequenceSpiral
    Manifest: Class-Path: biojava.jar
    I have biojava.jar on my classpath but not in same directory as SequenceSprial.jar
    java -jar SequenceSpiral.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/biojava/bio/seq/FeatureFilter
    3) Specify the path of the jar in the Manifest Classpath
    Manifest: Main-Class: org/biojava/app/SequenceSpiral
    Manifest: Class-Path: d:/biojava/biojava.jar
    I have biojava.jar on my classpath (D;\biojava\biojava.jar) but not in same directory as SequenceSprial.jar
    java -jar SequenceSpiral.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/biojava/bio/seq/FeatureFilter
    (note that in this case it is not fnding my main even though the Main-Class is specified)
    4) Specify current directory and biojava.jar in the Manifest Class-Path
    Manifest: Main-Class: org/biojava/app/SequenceSpiral
    Manifest: Class-Path: .;biojava.jar
    I have biojava.jar on my classpath (D;\biojava\biojava.jar) but not in same directory as SequenceSprial.jar
    java -jar SequenceSpiral.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/biojava/bio/seq/FeatureFilter
    5)Specify current directory and the URL of biojava.jar in the Manifest Class-Path
    Manifest: Main-Class: org/biojava/app/SequenceSpiral
    Manifest: Class-Path: . d:/biojava/biojava.jar
    I have biojava.jar on my classpath (D;\biojava\biojava.jar) but not in same directory as SequenceSprial.jar
    java -jar SequenceSpiral.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: org/biojava/bio/seq/FeatureFilter.
    Thank you very much for any help or suggestions,
    David Maynard

    I did some more testing and I think I now understand what is going on.
    I don't like it, but at least I understand it.
    The problem: I have an app packaged into a JAR file, myApp.jar. It has a dependancy upon an external JAR file extern.jar.
    extern.jar is on my Classpath (and also in jre/lib/ext)
    1) For some reason (bug?) java -jar myApp.jar does NOT use the classpath or the jre/lib/ext mechanisms to find .jar files needed to resolve references to external classes. This seems to be true even if you add an explicit -classpath argument on the command line!
    thus
    java -jar -cp c:\\absolutePathToMy\extern.jar myApp.jar
    also fails as does
    java -cp c:\\absolutePathToMy\extern.jar -jar myApp.jar
    2) Inside the myApp Jar file you can specify a URL to an jar extension jar file but the URL IS RELATIVE TO THE PATH WHERE THE myApp.Jar is executed from! If I add the Manifest item Class-Path: ..\..\..\myexterndir\extern.jar then
    java -jar myApp.jar
    works correctly and resolves the external references.
    This is why several people have reported that this class-path mechanism works ONLY when the extern.jar file is in the SAME DIRECTORY as the myApp.jar file when they had added a Class-Path: extern.jar to the Manifest.
    However together these two items make it IMPOSSIBLE to distribute myApp.jar to others and have it work since the path names statically encoded inside the jar are relative to where the jar gets executed from. If I move myApp.jar to a different location on my hard drive it may also fail.
    In my case I know all my customers already have extern.jar (5MB) installed on their classpaths and I would like to just send them the myApp.jar ( .5MB ).
    However I don't see how to do this given the current specification of a JAR file, and the bug that makes all -jar file act like they have the Sealed=true property.
    I tried explicity setting Sealed=false in the manifest but this didn't seem to have any effect.
    I hope that this will save others the many hours of time it has taken be to determine that JARS are not well suited for deploying apps with dependenncies on external libs.
    I also hope that someone can show me how execute a JAR and specify a classpath that doesn't get IGNORED my the classloader used in loading the jar classes.
    This is using java version:
    java version "1.4.1_01"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
    Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)
    Does any one know this bug is fixed in a later release?
    David Maynard

  • Jar file and Hot Folders

    I a trying to create a holt folder where I can execute the following command against a 100 files and output "screen output" to a file. However, when I run this unix comman on the list of files, only the first one is processed? "java -jar epubcheck-0.9.2.jar *.epub"
    Is there something wroing with the jar file? do I need to create a for loop? do I need to create a Java program and include this JAR file as a library?
    Any suggestions.

    Welcome to the Sun forums.
    >
    I a trying to create a holt folder where I can execute the following command against a 100 files and output "screen output" to a file. However, when I run this unix comman on the list of files, only the first one is processed? "java -jar epubcheck-0.9.2.jar *.epub">What this? Since the web is one heck of a big place, it pays to narrow down exactly what you are referring to by URL.
    >
    Is there something wroing with the jar file? do I need to create a for loop? do I need to create a Java program and include this JAR file as a library?>Well since it is a 3rd party tool (that I had never heard of before today) it might be best to take it up with the 3rd party. These forums are not designed or intended to provide support for 3rd party APIs.
    OTOH, surf on over to the [manual (AKA TFM) for this tool|http://code.google.com/p/epubcheck/wiki/Running] and the documentation strongly suggests it was only intended for one file at a time.
    If that is that case, you might call the Jar using Runtime.exec() in a loop of your own Java code.
    Your other idea of loading the class directly in your Java code, and proceeding from there is a better one strategically. But unfortunately that tool's homepage mentions the documentation is 'comging soon', and that presumably includes the JavaDocs.

  • JAR files and J2ME

    Just starting a J2ME project.
    An embarrassingly Noobie Question:
    1) All the classes that are supposedly "built-in" to my device (phone)
    do NOT need to be included in the deployed JAR file, right?
    2) Anyone know how to do that in Netbeans 5.0?
    Project -> Properties -> Build shows sources filtering
    but that doesn't include anything from my "input"/library .JARS.
    However, all the com.*, javax.* and java.* files are being included in
    my output JAR file and it causes failures in preverify and loading
    on the phone.
    HELP!!

    hi,
    any know this question
    please send me the procedures about how load my J2ME
    application(jad and jar file) into CDMA mobiles
    like(Nokia 6255,6235,6235i etc..).
    its very urgent for me,
    please anybody known this answer reply very soon.
    thanks a lot
    laxmi.Hi
    I am also having the same problem , any one has found solutions kindly inform. I want to install the spreadsheet viewer. Has any body developed solutions for the same - Please help
    Thanks a lot
    Ragupathi

  • Java jar file

    Hi all,
    I am developing web based application using apache as a webserver. I have one application which is located in the folder apache/webapps/foo/foo2/myapp.jar . This application must access the class which is located in the apache/webapps/foo/WEB-INF/classes. My question is what is the class-path should i put in the jar manifest file for my application to access the class in the WEB-INF/classes?

    HI,
    Can you give your directory structure like where you jsps located, and where your application get deployed? If you are trying deploy jar file there is no need to set any path to access the WEB-INF/classes, But if you want to access any specific class then give like
    Main-Class: com.myapp.className
    in your manifest file. Try this and if this not help you please give detailed problem scenario.
    Vimal

  • Jar files and Main-Class attribute

    Sorry, I know there are other topics regarding this argument but none of them helped me solving my problem.
    I've tried a thousand time in every possible way, but I still can't run my application from a jar file. I've got a package called client, whose main class is called Client. The package contains a sub-package called Icons. I've put everything into a jar file and added this manifest:
    Manifest version: 1.0
    Name: client/
    Sealed: True
    Main-Class: client.Client
    But it won't work. I've tried to erase the Sealed part, I've tried "Main-Class: Client" and also "client/Client", I've tried putting into the jar the client directory and I've tried omitting it, but the answer is always the same:
    Failed to load main-class header etc.
    Can anyone help me? Please, I'm almost desperate!
    Thanks

    Here's the verbose-mode description of what I did.
    jar -cfv client.jar clientaggiunto manifesto
    aggiunta in corso di: client/(in = 0) (out= 0)(archiviato 0%)
    aggiunta in corso di: client/.nbattrs(in = 767) (out= 310)(compresso 59%)
    aggiunta in corso di: client/Client.class(in = 533) (out= 340)(compresso 36%)
    aggiunta in corso di: client/Client.java(in = 288) (out= 140)(compresso 51%)
    aggiunta in corso di: client/ClientForm$1.class(in = 691) (out= 383)(compresso 44%)
    aggiunta in corso di: client/ClientForm$10.class(in = 678) (out= 380)(compresso 43%)
    aggiunta in corso di: client/ClientForm$11.class(in = 689) (out= 385)(compresso 44%)
    aggiunta in corso di: client/ClientForm$2.class(in = 686) (out= 379)(compresso 44%)
    aggiunta in corso di: client/ClientForm$3.class(in = 686) (out= 381)(compresso 44%)
    aggiunta in corso di: client/ClientForm$4.class(in = 686) (out= 380)(compresso 44%)
    aggiunta in corso di: client/ClientForm$5.class(in = 686) (out= 383)(compresso 44%)
    aggiunta in corso di: client/ClientForm$6.class(in = 718) (out= 399)(compresso 44%)
    aggiunta in corso di: client/ClientForm$7.class(in = 718) (out= 400)(compresso 44%)
    aggiunta in corso di: client/ClientForm$8.class(in = 718) (out= 399)(compresso 44%)
    aggiunta in corso di: client/ClientForm$9.class(in = 718) (out= 398)(compresso 44%)
    aggiunta in corso di: client/ClientForm.class(in = 33070) (out= 13510)(compresso 59%)
    aggiunta in corso di: client/ClientForm.form(in = 131398) (out= 4521)(compresso96%)
    aggiunta in corso di: client/ClientForm.java(in = 73435) (out= 6863)(compresso 90%)
    aggiunta in corso di: client/Icons/(in = 0) (out= 0)(archiviato 0%)
    aggiunta in corso di: client/Icons/brick.gif(in = 1044) (out= 1049)(compresso 0%)
    aggiunta in corso di: client/Icons/corpo.gif(in = 4011) (out= 3400)(compresso 15%)
    aggiunta in corso di: client/Icons/door.gif(in = 1092) (out= 1097)(compresso 0%)
    aggiunta in corso di: client/Icons/floor.gif(in = 1102) (out= 1107)(compresso 0%)
    aggiunta in corso di: client/Icons/mappa.gif(in = 20901) (out= 20575)(compresso 1%)
    aggiunta in corso di: client/Icons/paesaggio.gif(in = 18962) (out= 18603)(compresso 1%)
    aggiunta in corso di: client/Icons/sole.gif(in = 7063) (out= 6546)(compresso 7%)
    aggiunta in corso di: client/Icons/trap.gif(in = 1062) (out= 1067)(compresso 0%)
    aggiunta in corso di: client/Icons/void.gif(in = 842) (out= 847)(compresso 0%)
    aggiunta in corso di: client/Listener.class(in = 1869) (out= 1136)(compresso 39%)
    aggiunta in corso di: client/Listener.java(in = 2296) (out= 708)(compresso 69%)
    aggiunta in corso di: client/manifesto.txt(in = 62) (out= 58)(compresso 6%)
    aggiunta in corso di: client/ScorciatoieDialog$1.class(in = 740) (out= 391)(compresso 47%)
    aggiunta in corso di: client/ScorciatoieDialog$PopupListener.class(in = 1579) (out= 773)(compresso 51%)
    aggiunta in corso di: client/ScorciatoieDialog.class(in = 3524) (out= 1638)(compresso 53%)
    aggiunta in corso di: client/ScorciatoieDialog.form(in = 8500) (out= 910)(compresso 89%)
    aggiunta in corso di: client/ScorciatoieDialog.java(in = 5676) (out= 1222)(compresso 78%)
    jar umf mainclass.txt client.jar[NOTE: mainclass.txt only contains the line "Main-Class: client.Client"]
    java -jar client.jarFailed to load Main-Class manifest attribute from
    client.jar
    I've also tried to manually create a MANIFEST.MF file that only contained the following lines:
    Manifest Version: 1.0
    Main-Class: client.Client
    guess what was the result?
    java -jar client.jarException in thread "main" java.io.IOException: invalid manifest format
    at java.util.jar.Manifest.read(Manifest.java:193)
    at java.util.jar.Manifest.<init>(Manifest.java:52)
    at java.util.jar.JarFile.getManifest(JarFile.java:158)
    >
    the same procedure with the addition of "Name: client/" before the main-class attribute generated the usual "Failed to load Main-Class manifest attribute" result. So now what?!? I'm getting crazy....

  • Howto execute java jar file via html ?

    hi
    howto execute java jar file via html ?
    could someone pls post a html code ?
    kind regards
    upiter77

    hi
    howto execute java jar file via html ?You can't.
    could someone pls post a html code ?No. you can search for yourself and find the code you need.
    Now, it sounds to me like you're trying to build an Applet or do Web Start or something. In any event, you need...wait for it....Google! :-)

  • How to Add JAR files and Config files to CLASSPATH at runtime?

    QUERY:
    During runtime, I need to load the JAR files and relevant config files( .cfg files and .properties file) into CLASSPATH and run a specific java program from one of the JAR which is available in CLASSPATH.
    Please advise me any relevant Java API details or a sample java program to implement the above use case.
    Thanks in advance.

    During runtime, I need to load the JAR files and relevant config files( .cfg files and .properties file) into CLASSPATH and run a specific java program from one of the JAR which is available in CLASSPATH.
    Please advise me any relevant Java API details or a sample java program to implement the above use case.
    You don't add to YOUR classpath once your app is launched.
    You create a NEW process for the app you want to run and provide the proper environment for it to run in - including any PATH or CLASSPATH environment variables.
    The Java API for the ProcessBuilder class has a simple example that shows how to create the arguments and launch an external application.
    ProcessBuilder (Java Platform SE 7 )
    There are also PLENTY of other examples of using ProcessBuilder; just search the net.

  • Decompiling jar file and then run

    Dear Members,
    I have a jar file and I have decompiled that jar file and converted into class file,
    now I want to run/edit using source code ,I am unable to run source code with out put whatever coming in jar file running,
    I am trying with class in which
    public static void main(String[] args)
    function defined,
    I am using Jcreater1.5 and from command prompt also running but unable to run and edit the programm,
    how to run these class file in complete project that output will come as running jar file
    regards
    SACHIN

    It sounds like you have unpacked the jar.
    To edit the source you need to decompile the classes to .java files.
    [http://www.google.co.uk/search?q=java+decompiler]

Maybe you are looking for