Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: Will Java compiled in windows work in Linux? Date: Thu, 27 Mar 2014 14:58:27 -0400 Organization: A noiseless patient Spider Lines: 26 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 27 Mar 2014 18:58:29 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="bd4e1cba8d8592bec5d5ed9e4537fbfd"; logging-data="32544"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Jt0w+2yToKxdlTmC8zy/0" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: Cancel-Lock: sha1:f8fbeG+XjhXEAHLRUJgV46H4t8U= Xref: csiph.com comp.lang.java.programmer:27891 On 3/27/2014 1:50 PM, D. Xenakis wrote: > I have installed on my host linux server online the following file: "traccar-linux-64-2.7.zip (26-Jan-2014)" downloaded from the following link (http://www.traccar.org/download.jsp) > > First question: If i want to compile from scratch on my machine using their source code unmodificated from here (http://www.traccar.org/source.jsp), would the new generated traccar.run file, have the same hash with "traccar-linux-64-2.7.zip (26-Jan-2014)" ? I mean are they going to be identical? Possibly not. If you compile with a different Java version than they used, the class file format's version number might be different. If you use different compiler options than they did, the class files may contain different kinds and amounts of debugging information. Even if the class files are identical, the archive's hash code may be different if you used a different ZIP utility. The "payload" in the class files should be identical (barring severe version skew), but you'll need something more context-aware than a full-file checksum. > Second question: Should i compile this through a linux environment? For example Ubuntu, or can i do the compile from Windows environment too? For example windows 8.1 ? If the code is entirely in Java, it'll be "the same" (see above) no matter what environment it's compiled on. If there's any native (non-Java) code, or if the archive includes things like installers and such, all bets are off. -- Eric Sosman esosman@comcast-dot-net.invalid