-
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?
-
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.
-
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.
-
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.
-
Re: Jar Issues
mineCraft is not Minecrafts main class. You can only open minecraft using a launcher, or MCP.