ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
but when i compile my program on xp or fedora8 it worked only on xp and fedora8 but not mac
also i tried it on an older xp machine and it didn't work
when i compiled it on mac it worked on mac and xp but didn't try it on older xp yet
this seems to be a issue with some version number
only thing i saw was maybe multiple jre's installed or compiled with different versions ???
it is kinda lame ... i thought java worked anywhere but i had to do a little work to make this so
i had to get my hands on a mac and compile code there then when i made jar file it seems to work everywhere
also when i try to double click my executable jar file in linux
it seems to treat it just like a archive file like a zip
why didn't it run the program
and how would i make it an application for linux
and why does it only seems to be platform independant when complied w/ mac
when i can get to them i will
just a little lame - this issue is mucking up one of the beauties of the language
java -version = 1.6.0_03 on this xp laptop
i downloaded it not too long ago and on fedora8 i used whatever comes with eclipse on the install dvd
as far as my families mac's ... hell i dunno whatever comes with them
my dads is new and mom and sisters are older
i assume this laptop is newer than most if not all of the other machines so i don't get it ... i guess that word MOSTLY backwards compatible is the key
why would 6 not run on 5 ... isn't that what backwards compatible means
1. You seem to think double-clicking on a .jar should run it as a program
Granted, that might be convenient in some cases. It might be downright annoying in other cases. What if you need multiple .jars? What if you have multiple different "main()" entries? What if you just want to look at the contents of a resource .jar? What if it's malicious? Etc etc ad nauseum...
Bottom line: nobody says it has to work this way; and, more often than not, it simply *doesn't*.
2. You are correct: your Java Runtime must be greater than or equal to the Java version that the .class files in the .jar were compiled under.
There are many ways to achieve this.
For example, you can make sure the latest/greatest runtime is loaded. You can install *multiple* runtimes (and switch between them with a simple environment setting, like $JAVA_HOME, or changing your -classpath). Or you can explicitly tell a new compiler to write .class files compatible with an older version (e.g. -target).
what do you recommend then
java doesn't compile into any executable format
executable jar seems the best
all you have to do it double click and it runs the program
just run jar xvf filename.jar to extract it
my dads mac has this cool xcode developer tools that can make .app files from java files
seen things like this for windows but they seem to cost money
i made a sudoku game for my grandma and this seems to be the best way to give it to her ... all she has to do it get one file and double click it