Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Jar Issues

  1. #1
    Junior Member
    Join Date
    Apr 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Jar Issues

    I am attempting to create a jar file, however i am having a difficult time solving it as i personally do not have access to a machine that can not run the jar file. It works fine on my computer, school computer and a friends computer. However, none of my other friends i send it to can get it to work unless they personally compile or make a jar file.

    The problem i am told they are getting is the main class issue where it cannot be found. I have tried a handful of different methods i was able to find online to fix this but none have seemed to work, and i am also getting tired of sending and resending jar files to see if they work. The final issue i was not able to test is that jar files can only be run in the environment they were created in. I have java 7 but it seems the rest of the world has java 6. will i need to download java 6 and compile using that JRE and pray that it doesnt update tomorrow morning?


  2. #2
    Member
    Join Date
    Apr 2012
    Location
    Superior, CO, USA
    Posts
    80
    Thanks
    0
    Thanked 14 Times in 14 Posts

    Default Re: Jar Issues

    How are you compiling the Java files within the Jar? What is the exact error that your friends are getting? If they're on Java 6 then try that - it isn't too bad to have multiple environments.

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Jar Issues

    Are you relying on any features of java 7? If so, anyone using your app requires java7. If not, you can compile with a minimum java version that allows earlier versions to run a java application compiled on a later JDK (see the target option for javac).

    I would recommend talking your friend through the process of running the jar via command line, as this will give you a definitive error code that you can work with.

  4. #4
    Junior Member
    Join Date
    Apr 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Jar Issues

    i am currently late for class so this will be a quick replay for the most part. my friends error from what i was told was "could not find main class: mineCraft", however my one friend that is java savvy said the manifest was fine and all the files were there. he was able to compile and run it himself without using the jar file. i used command line and eclipse to make jars but neither version worked.

    one question i have with java 6 is how will i make a jar with it using eclipse? right clicking the library and selecting properties i see i can change the execution library to 1.6 but it still has 1.7 parenthesis next to it. is it the option for the alternative JRE which currently only shows java 7 but will have 6 when i install it?

    i am relatively new to java programming for about 3 months, so i do not know if i am using any java 7 features, however my guess is that i am not, when i change my execution environment to 1.6 it compiles and runs without errors. i will also look at the target option as opposed to using eclipse for making the jar, i just dislike using the command line when clicking a few buttons on an IDE will suffice. i apologize for the hasty response but i am currently late for my class and will not be home until tonight, so this issue will go unresolved until tomorrow i expect.

  5. #5
    Junior Member
    Join Date
    May 2012
    Location
    Missouri
    Posts
    12
    My Mood
    Relaxed
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Jar Issues

    mineCraft is not Minecrafts main class. You can only open minecraft using a launcher, or MCP.

Similar Threads

  1. Array Issues
    By daemonlies in forum What's Wrong With My Code?
    Replies: 20
    Last Post: April 29th, 2012, 05:52 AM
  2. [SOLVED] Searching issues.
    By Saintroi in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 28th, 2012, 07:26 PM
  3. [SOLVED] Memory issues..?
    By Saintroi in forum What's Wrong With My Code?
    Replies: 10
    Last Post: April 24th, 2012, 10:31 PM
  4. Noobie issues?
    By sukuiichuu in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 3rd, 2011, 05:10 AM
  5. Recursion issues.
    By ender16 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: April 30th, 2011, 09:03 PM