|
Netbeans Java & *.exe files |
type568
Member #8,381
March 2007
|
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's slowness(hell, it is slow!). However, it's an *.exe file, not a *.jar, which I get when building my Java stuff.. So, two things: 1. How do I turn my *.jar to *.exe? P.S: Append:
|
verthex
Member #11,340
September 2009
|
type568
Member #8,381
March 2007
|
Barely anything new there.. It's all obvious. I'm seeking deeper thoughts related with the topic, it also doesn't any touch the fact Netbeans itself is an *.exe file, although AFAIK is written in Java.
|
Timorg
Member #2,028
March 2002
|
I assume it is like how you can use "exedat" 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. There is also a java frontend for GCC that compiles the program as a native executable, not requiring java to be installed on the computer the application is deployed on. ____________________________________________________________________________________________ |
verthex
Member #11,340
September 2009
|
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. Here's an interesting reference on java.exe. Its a lot of information though. Theres also something call Jsmooth Here's an actual article on the topic you asked for.
|
Archon
Member #4,195
January 2004
|
type568 said: However, it's an *.exe file, not a *.jar, which I get when building my Java stuff.. jar is Java Archive. It is a plain zip file with some META-INFormation. Unzipping it would give you the separate packages and class files. You don't need to jar your .class files in order for the Java project to work. Quote: 1. How do I turn my *.jar to *.exe? Google. Quote: 2. Why the heck is Netbeans still SO SLOW, relatively to let's say MSVS? It'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't have to say invoke "java" with the jar and classpath parameters if I want to run it because it has the native launcher (netbeans-6.8 binary file). |
verthex
Member #11,340
September 2009
|
Archon said: It's still Java and not a natively compiled C application. 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'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.
|
bamccaig
Member #7,536
July 2006
|
1#include <stdlib.h>
2
3#if WIN32
4 #include <process.h>
5
6 #define execvp _execvp
7#else
8 #include <unistd.h>
9#endif
10
11int main(int argc, char * argv[])
12{
13 int i;
14 int jargc = (argc + 2);
15 char ** jargv = (char **)malloc(sizeof (char *) * jargc + 1);
16
17 if(jargv == 0)
18 goto fatal;
19
20 jargv[0] = "java";
21 jargv[1] = "-jar";
22 jargv[2] = "/absolute/path/to/my.jar";
23
24 for(i=1; i<argc; i++)
25 jargv[i + 2] = argv[i];
26
27 jargv[jargc] = 0;
28
29 if(execvp(jargv[0], jargv) == -1)
30 goto fatal;
31
32 return 0;
33
34fatal:
35 perror(0);
36 exit(1);
37}
(Untested)
-- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
type568
Member #8,381
March 2007
|
So many letters.. So the open question remains- is what that Netbeans is.. How much is it a byte code, are a set of instructions or whatsoever..
|
Crazy Photon
Member #2,588
July 2002
|
type568 said: 1. How do I turn my *.jar to *.exe? 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). Quote: 2. Why the heck is Netbeans still SO SLOW, relatively to let's say MSVS? 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. type568 said: How much is it a byte code, are a set of instructions or whatsoever ----- |
bamccaig
Member #7,536
July 2006
|
I haven'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's what my sample program above claims to do, although it's untested and I have no idea if it actually works. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Arthur Kalliokoski
Second in Command
February 2005
|
What about the JIT stuff? Why can't that just be inserted into the middle of an .exe "template", as it were? They all watch too much MSNBC... they get ideas. |
Crazy Photon
Member #2,588
July 2002
|
The point about JIT is to optimize for processor-specific code, not just target architecture. ----- |
bamccaig
Member #7,536
July 2006
|
Crazy Photon said: The point about JIT is to optimize for processor-specific code, not just target architecture. When the program is installed it can be JIT'd and output into an executable. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Crazy Photon
Member #2,588
July 2002
|
bamccaig said: When the program is installed it can be JIT'd and output into an executable. It could be, that is very similar to how it works in .NET after all. I don't know if there are any Java VM implementations that do that, though. ----- |
|