<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Netbeans Java &amp; *.exe files</title>
		<link>http://www.allegro.cc/forums/view/603963</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 05 May 2010 03:42:09 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Having a look at some short thread in the programming forum related with IDEs, I dropped a look at my Netbeans 6.8.. As I know, that IDE was coded in Java, which is sort of an argument for it&#39;s slowness(hell, it is slow!).</p><p>However, it&#39;s an *.exe file, not a *.jar, which I get when building my Java stuff..<br />I know *.exe is a set of &quot;instructions&quot; for the OS(CPU directly?), while *.jar is a byte code, that&#39;s translated to these &quot;instructions&quot;, before it&#39;s execution..</p><p>So, two things:</p><p>1. How do I turn my *.jar to *.exe?<br />2. Why the heck is Netbeans still SO SLOW, relatively to let&#39;s say MSVS?</p><p>P.S:<br />But hell, it&#39;s still a lot better than Dev-C++, &amp; is also free.. I&#39;ll go suggest it as a &quot;decent IDE&quot; for this guy.. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><p>Append:<br />Missed a comma in the thread name:(
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (type568)</author>
		<pubDate>Tue, 04 May 2010 11:52:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><a href="http://answers.yahoo.com/question/index?qid=20080709121757AAgz5q1">Here&#39;s a thread on Yahoo Answers!</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (verthex)</author>
		<pubDate>Tue, 04 May 2010 11:55:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Barely anything new there.. It&#39;s all obvious. I&#39;m seeking deeper thoughts related with the topic, it also doesn&#39;t any touch the fact Netbeans itself is an *.exe file, although AFAIK is written in Java.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (type568)</author>
		<pubDate>Tue, 04 May 2010 12:00:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I assume it is like how you can use &quot;exedat&quot; to attach data to an executable. Basically there is a boot loader, that loads the data, (java code in this case,) then runs it with the java executable.</p><p>There is also a <a href="http://gcc.gnu.org/java/">java frontend for GCC</a> that compiles the program as a native executable, not requiring java to be installed on the computer the application is deployed on.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Timorg)</author>
		<pubDate>Tue, 04 May 2010 12:10:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well .bat were once used during the heyday of the command.exe era of windows when windows existed on ms-dos. Basically running a shell script is somehow equivalent to running a jar file.</p><p><a href="http://mindprod.com/jgloss/javaexe.html">Here&#39;s an </a> interesting reference on java.exe. Its a lot of information though.</p><p><a href="http://jsmooth.sourceforge.net/">Theres also something call Jsmooth</a></p><p><a href="http://www.excelsior-usa.com/articles/java-to-exe.html">Here&#39;s an actual article on the topic</a> you asked for.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (verthex)</author>
		<pubDate>Tue, 04 May 2010 12:12:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/603963/863766#target">type568</a> said:</div><div class="quote"><p>However, it&#39;s an *.exe file, not a *.jar, which I get when building my Java stuff..<br />I know *.exe is a set of &quot;instructions&quot; for the OS(CPU directly?), while *.jar is a byte code, that&#39;s translated to these &quot;instructions&quot;, before it&#39;s execution..</p></div></div><p>
jar is <b>J</b>ava <b>Ar</b>chive. It is a plain zip file with some META-INFormation. Unzipping it would give you the separate packages and class files. You don&#39;t need to jar your .class files in order for the Java project to work.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>1. How do I turn my *.jar to *.exe?</p></div></div><p>
Google.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>2. Why the heck is Netbeans still SO SLOW, relatively to let&#39;s say MSVS?</p></div></div><p>
It&#39;s still Java and not a natively compiled C application. The .exe file merely starts the application for you. I have Netbeans installed and I don&#39;t have to say invoke &quot;java&quot; with the jar and classpath parameters if I want to run it because it has the native launcher (netbeans-6.8 binary file).
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Archon)</author>
		<pubDate>Tue, 04 May 2010 13:00:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/603963/863780#target">Archon</a> said:</div><div class="quote"><p>It&#39;s still Java and not a natively compiled C application. </p></div></div><p>

That and its memory intensive. Each byte in Java is represented as a word because thats how the VM sees things when it works on an arbitrary CPU. I&#39;m sure the details are covered somewhere, I found this out on wikipedia although they should have a reference to that statement with more depth.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (verthex)</author>
		<pubDate>Tue, 04 May 2010 13:14:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="source-code"><div class="toolbar"><span class="button numbers"><b>#</b></span><span class="button select">Select</span><span class="button expand">Expand</span></div><div class="inner"><span class="number">  1</span><span class="p">#include &lt;stdlib.h&gt;</span>
<span class="number">  2</span>
<span class="number">  3</span><span class="p">#if WIN32</span>
<span class="number">  4</span>    <span class="p">#include &lt;process.h&gt;</span>
<span class="number">  5</span>
<span class="number">  6</span>    <span class="p">#define execvp _execvp</span>
<span class="number">  7</span><span class="p">#else</span>
<span class="number">  8</span>    <span class="p">#include &lt;unistd.h&gt;</span>
<span class="number">  9</span><span class="p">#endif</span>
<span class="number"> 10</span>
<span class="number"> 11</span><span class="k1">int</span> main<span class="k2">(</span><span class="k1">int</span> argc, <span class="k1">char</span> <span class="k3">*</span> argv<span class="k2">[</span><span class="k2">]</span><span class="k2">)</span>
<span class="number"> 12</span><span class="k2">{</span>
<span class="number"> 13</span>    <span class="k1">int</span> i<span class="k2">;</span>
<span class="number"> 14</span>    <span class="k1">int</span> jargc <span class="k3">=</span> <span class="k2">(</span>argc <span class="k3">+</span> <span class="n">2</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 15</span>    <span class="k1">char</span> <span class="k3">*</span><span class="k3">*</span> jargv <span class="k3">=</span> <span class="k2">(</span><span class="k1">char</span> <span class="k3">*</span><span class="k3">*</span><span class="k2">)</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_551.html" target="_blank">malloc</a><span class="k2">(</span><span class="k1">sizeof</span> <span class="k2">(</span><span class="k1">char</span> <span class="k3">*</span><span class="k2">)</span> <span class="k3">*</span> jargc <span class="k3">+</span> <span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 16</span>
<span class="number"> 17</span>    <span class="k1">if</span><span class="k2">(</span>jargv <span class="k3">=</span><span class="k3">=</span> <span class="n">0</span><span class="k2">)</span>
<span class="number"> 18</span>        <span class="k1">goto</span> fatal<span class="k2">;</span>
<span class="number"> 19</span>
<span class="number"> 20</span>    jargv<span class="k2">[</span><span class="n">0</span><span class="k2">]</span> <span class="k3">=</span> <span class="s">"java"</span><span class="k2">;</span>
<span class="number"> 21</span>    jargv<span class="k2">[</span><span class="n">1</span><span class="k2">]</span> <span class="k3">=</span> <span class="s">"-jar"</span><span class="k2">;</span>
<span class="number"> 22</span>    jargv<span class="k2">[</span><span class="n">2</span><span class="k2">]</span> <span class="k3">=</span> <span class="s">"/absolute/path/to/my.jar"</span><span class="k2">;</span>
<span class="number"> 23</span>
<span class="number"> 24</span>    <span class="k1">for</span><span class="k2">(</span>i<span class="k3">=</span><span class="n">1</span><span class="k2">;</span> i<span class="k3">&lt;</span>argc<span class="k2">;</span> i<span class="k3">+</span><span class="k3">+</span><span class="k2">)</span>
<span class="number"> 25</span>        jargv<span class="k2">[</span>i <span class="k3">+</span> <span class="n">2</span><span class="k2">]</span> <span class="k3">=</span> argv<span class="k2">[</span>i<span class="k2">]</span><span class="k2">;</span>
<span class="number"> 26</span>
<span class="number"> 27</span>    jargv<span class="k2">[</span>jargc<span class="k2">]</span> <span class="k3">=</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 28</span>
<span class="number"> 29</span>    <span class="k1">if</span><span class="k2">(</span>execvp<span class="k2">(</span>jargv<span class="k2">[</span><span class="n">0</span><span class="k2">]</span>, jargv<span class="k2">)</span> <span class="k3">=</span><span class="k3">=</span> <span class="k3">-</span><span class="n">1</span><span class="k2">)</span>
<span class="number"> 30</span>        <span class="k1">goto</span> fatal<span class="k2">;</span>
<span class="number"> 31</span>
<span class="number"> 32</span>    <span class="k1">return</span> <span class="n">0</span><span class="k2">;</span>
<span class="number"> 33</span>
<span class="number"> 34</span>fatal:
<span class="number"> 35</span>    <a href="http://www.delorie.com/djgpp/doc/libc/libc_615.html" target="_blank">perror</a><span class="k2">(</span><span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 36</span>    <a href="http://www.delorie.com/djgpp/doc/libc/libc_298.html" target="_blank">exit</a><span class="k2">(</span><span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<span class="number"> 37</span><span class="k2">}</span>
</div></div><p>
<i>(Untested)</i></p><p><img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Tue, 04 May 2010 20:19:28 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>So many letters..<br />Bamcca I don&#39;t understand you literally. Vertex, I&#39;ve had a looked on it, I&#39;ll look deeper.</p><p>So the open question remains- is what that Netbeans is.. How much is it a byte code, are a set of instructions or whatsoever..
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (type568)</author>
		<pubDate>Tue, 04 May 2010 22:47:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/603963/863766#target">type568</a> said:</div><div class="quote"><p> 1. How do I turn my *.jar to *.exe?</p></div></div><p>As mentioned above, there are tools for that, basically they just run the Java VM with a predefined jar (some tools embed the jar inside the exe).</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> 2. Why the heck is Netbeans still SO SLOW, relatively to let&#39;s say MSVS?</p></div></div><p>Java bytecodes are interpreted while .NET IL gets compiled to the native processor before running. Modern Java VMs compile the most used code at runtime, and you can even tune them to get more performance (such as using the server VM instead of a client one, increasing maximum memory, disabling bytecode validation, etc.). EDIT: IDE internal design differences also play a part as well.</p><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/603963/863830#target">type568</a> said:</div><div class="quote"><p> How much is it a byte code, are a set of instructions or whatsoever</p></div></div><p><a href="http://en.wikipedia.org/wiki/Java_bytecode">http://en.wikipedia.org/wiki/Java_bytecode</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Crazy Photon)</author>
		<pubDate>Wed, 05 May 2010 00:06:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I haven&#39;t looked into it, but I know NetBeans (or at least the bulk of it) was written in Java. More than likely, the executable is just a simple program to launch the Java code. That&#39;s what my sample program above claims to do, although it&#39;s untested and I have no idea if it actually works.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Wed, 05 May 2010 00:07:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What about the JIT stuff?  Why can&#39;t that just be inserted into the middle of an .exe &quot;template&quot;, as it were?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Wed, 05 May 2010 00:27:01 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The point about JIT is to optimize for processor-specific code, not just target architecture.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Crazy Photon)</author>
		<pubDate>Wed, 05 May 2010 02:39:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/603963/863869#target">Crazy Photon</a> said:</div><div class="quote"><p>
The point about JIT is to optimize for processor-specific code, not just target architecture.
</p></div></div><p>
When the program is installed it can be JIT&#39;d and output into an executable.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (bamccaig)</author>
		<pubDate>Wed, 05 May 2010 03:27:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/603963/863876#target">bamccaig</a> said:</div><div class="quote"><p> When the program is installed it can be JIT&#39;d and output into an executable.</p></div></div><p>It could be, that is very similar to how it works in .NET after all. I don&#39;t know if there are any Java VM implementations that do that, though.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Crazy Photon)</author>
		<pubDate>Wed, 05 May 2010 03:42:09 +0000</pubDate>
	</item>
</rss>
