Results 1 to 12 of 12
  1. #1
    Java Tyler is offline Member
    Join Date
    Aug 2010
    Posts
    5
    Rep Power
    0

    Default .Jar Not Recognized

    Sorry guys i'm confused and not sure if this is the place, but i downloaded the new Java, jre6_21, and now all my .jar files arn't recognized.. I tried opening with..
    C:\Program Files\Java\jre6\bin\Javaw.exe
    But that doesn't seem to work.. Can anyone help me or if this isn't the forum for this can someone tell me where it would be? :P

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,884
    Rep Power
    25

    Default

    all my .jar files arn't recognized
    C:\Program Files\Java\jre6\bin\Javaw.exe
    That command shouldn't work as shown. It needs the -jar option before the jarfilename.
    Have you tried opening a command prompt and using the "java.exe -jar" command?

    Can you double click on a jar file and have it execute?

    Look at the registry's file extension association table entry:
    Open Windows Explorer
    Click on Tools menu
    Click on Folder Options
    Select File Types tab
    Scroll down in the "Registered file types:" list until you see an entry for JAR.
    Select the JAR entry.
    Click the Advanced button
    In the Edit File Type window scroll down the list of Actions until you see the one in bold.
    Select the bold one
    Click the Edit button
    Select, Copy and paste here what is in the "Application used to perform action:" window.

    Be careful not to change anything and Cancel your way out of the open windows.



    In Windows explorer what does it show in the Type column?

  3. #3
    Java Tyler is offline Member
    Join Date
    Aug 2010
    Posts
    5
    Rep Power
    0

    Default

    I do java.exe -jar only a bunch of other commands come up?
    Also i have windows 7, i saw no File Types tab or anything related..

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,884
    Rep Power
    25

    Default

    I do java.exe -jar only a bunch of other commands come up?
    please copy and paste the full text of what you see.
    To copy the contents of the command prompt window:
    Click on Icon in upper left corner
    Select Edit
    Select 'Select All' - The selection will show
    Click in upper left again
    Select Edit and click 'Copy'

    Paste here.

    Sorry about Windows 7. I have no idea where MS has hidden that table or how to get to it.
    Try Google.

    Have you read the API doc for how to use the java.exe command? Is your usage correct?

  5. #5
    Java Tyler is offline Member
    Join Date
    Aug 2010
    Posts
    5
    Rep Power
    0

    Default

    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Users\owner>java.exe -jar
    Usage: java [-options] class [args...]
    (to execute a class)
    or java [-options] -jar jarfile [args...]
    (to execute a jar file)

    where options include:
    -client to select the "client" VM
    -server to select the "server" VM
    -hotspot is a synonym for the "client" VM [deprecated]
    The default VM is client.

    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
    A ; separated list of directories, JAR archives,
    and ZIP archives to search for class files.
    -D<name>=<value>
    set a system property
    -verbose[:class|gc|jni]
    enable verbose output
    -version print product version and exit
    -version:<value>
    require the specified version to run
    -showversion print product version and continue
    -jre-restrict-search | -jre-no-restrict-search
    include/exclude user private JREs in the version search
    -? -help print this help message
    -X print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
    enable assertions
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
    disable assertions
    -esa | -enablesystemassertions
    enable system assertions
    -dsa | -disablesystemassertions
    disable system assertions
    -agentlib:<libname>[=<options>]
    load native agent library <libname>, e.g. -agentlib:hprof
    see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
    load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
    load Java programming language agent, see java.lang.instrument

    -splash:<imagepath>
    show splash screen with specified image
    And i've tried googling it all that i get is a bunch of programs that require cash to use..
    Any advice from here?
    Last edited by Java Tyler; 08-05-2010 at 10:40 PM.

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,884
    Rep Power
    25

    Default

    You left off the name of the jar file.

    Did you read what was on the screen?
    or java [-options] -jar jarfile [args...]
    (to execute a jar file)
    Have you read the API doc for how to use the java.exe command?

  7. #7
    Java Tyler is offline Member
    Join Date
    Aug 2010
    Posts
    5
    Rep Power
    0

    Default

    Sorry for the delay here is wat i get

    That is what i got when i run it ps it worked 1 time in cmd but i forgot to snapshot it.

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,884
    Rep Power
    25

    Default

    You left off the command line. Did you forget the -jar option?
    To copy the contents of the command prompt window:
    Click on Icon in upper left corner
    Select Edit
    Select 'Select All' - The selection will show
    Click in upper left again
    Select Edit and click 'Copy'

    Paste here.

  9. #9
    Java Tyler is offline Member
    Join Date
    Aug 2010
    Posts
    5
    Rep Power
    0

    Default

    Microsoft Windows [Version 6.1.7600]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Users\owner>java -jar RSBot.jar
    Ps. It showed the picture i posted up there b4.
    Last edited by Java Tyler; 08-12-2010 at 05:53 AM.

  10. #10
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,884
    Rep Power
    25

    Default

    Somehow your typing in part of it and showing an image doesn't show that what you have typed in caused what is shown in the image.

    Can you copy and paste here the FULL screen for when you execute the command line and it generates the error. Don't post the image, copy and paste as described before in posts #4 and #8

  11. #11
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,773
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by Java Tyler View Post
    Ps. It showed the picture i posted up there b4.
    So you typed the correct command line before; if that happened in the same shell (command line interpreter) simply press the up arrow until you can see it again ...

    kind regards,

    Jos

  12. #12
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,884
    Rep Power
    25

    Default

    For example:
    D:\JavaDevelopment>java D:\JavaDevelopment\acme.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: D:\JavaDevelopment\acme/jar
    Caused by: java.lang.ClassNotFoundException: D:\JavaDevelopment\acme.jar
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    Could not find the main class: D:\JavaDevelopment\acme.jar. Program will exit.

Similar Threads

  1. javac is not recognized command...
    By javastudent87 in forum New To Java
    Replies: 6
    Last Post: 07-30-2010, 06:50 AM
  2. Javac not recognized
    By OscarLiu in forum New To Java
    Replies: 8
    Last Post: 06-29-2010, 04:10 PM
  3. 'java is not recognized' vista
    By dylan mc in forum New To Java
    Replies: 3
    Last Post: 08-16-2009, 06:54 PM
  4. Javac is not recognized?
    By Java idiot in forum New To Java
    Replies: 4
    Last Post: 08-03-2009, 07:54 PM
  5. javac command not recognized
    By sunshine39 in forum New To Java
    Replies: 7
    Last Post: 03-04-2009, 04:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •