Results 1 to 7 of 7
  1. #1
    YasielPuig is offline Member
    Join Date
    Dec 2016
    Posts
    4
    Rep Power
    0

    Default Can't open java program

    Long story short, I have a very important program and I can't retrieve it. Eclipse says it can't view the file and it just comes up as a bunch of gibberish in JGrasp and Notepd


    Any suggestions?

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Can't open java program

    What is the name of the file?

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    YasielPuig is offline Member
    Join Date
    Dec 2016
    Posts
    4
    Rep Power
    0

    Default Re: Can't open java program

    Quote Originally Posted by jim829 View Post
    What is the name of the file?

    Regards,
    Jim
    FroggerSolution.Java

  4. #4
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Can't open java program

    It may be misnamed. It may not like the .Java vs .java. If it is gibberish it could be a class file
    or a jar file (or even a zip file). You can try the following in a console window (your path name
    needs to be set correctly to find the executable).

    jar tvf FroggerSolution.java

    to see if it lists the contents.

    If you have a binary editor, and see the hex digits CAFEBABE, that indicates a class file.

    Regards,
    Jim
    Last edited by jim829; 12-09-2016 at 09:17 PM.
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  5. #5
    YasielPuig is offline Member
    Join Date
    Dec 2016
    Posts
    4
    Rep Power
    0

    Default Re: Can't open java program

    Quote Originally Posted by jim829 View Post
    It may be misnamed. It may not like the .Java vs .java. If it is gibberish it could be a class file
    or a jar file (or even a zip file). You can try the following in a console window (your path name
    needs to be set correctly to find the executable).

    jar tvf FroggerSolution.java

    to see if it lists the contents.

    If you have a binary editor, and see the hex digits CAFEBABE, that indicates a class file.

    Regards,
    Jim
    It is indeed a class file

  6. #6
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Can't open java program

    Thats a problem. It was misnamed. I don't know if it is directly executable or not. You may try the following (again in a console
    window with appropriate pathnames).

    First, rename it with a .class extension. Then do

    java FroggerSolution

    or

    java -cp . FroggerSolution

    if the class path isn't set. But beware that the program could do nasty things if it isn't the program you expected. It
    might be better to try and find the source code to ensure it is what you wanted.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  7. #7
    YasielPuig is offline Member
    Join Date
    Dec 2016
    Posts
    4
    Rep Power
    0

    Default Re: Can't open java program

    Quote Originally Posted by jim829 View Post
    Thats a problem. It was misnamed. I don't know if it is directly executable or not. You may try the following (again in a console
    window with appropriate pathnames).

    First, rename it with a .class extension. Then do

    java FroggerSolution

    or

    java -cp . FroggerSolution

    if the class path isn't set. But beware that the program could do nasty things if it isn't the program you expected. It
    might be better to try and find the source code to ensure it is what you wanted.

    Regards,
    Jim
    I got it to work!

    I Used javadecompilers.com

    Thank you for taking the time to help me

Similar Threads

  1. Replies: 19
    Last Post: 07-17-2015, 03:40 PM
  2. Save, open, close, etc. structure in java program
    By Karlovsky120 in forum AWT / Swing
    Replies: 3
    Last Post: 07-20-2013, 04:36 PM
  3. Open visio by java program
    By RaXyz in forum New To Java
    Replies: 0
    Last Post: 02-16-2012, 09:14 AM
  4. Replies: 3
    Last Post: 03-28-2011, 04:57 PM
  5. Replies: 1
    Last Post: 01-13-2010, 05:58 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
  •