• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java to Native?  RSS feed

 
emilio rossi
Ranch Hand
Posts: 47
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
write this post just to up a topic whic seems to have no news

is still excelsior jet the one and only valid alternative for creating exe from java code?

in my experience i tryed JNC(not even able to compile hello world), GCJ (nothing with a frame involved can work), Jarc plugin fo eclipse(compiled tons of "nothing happened" exe files).
excelsior jet is the only who allowed me to create 100% functional exes from my java code.
i believe this software costs so much cause there is no alternative around.
Or do i miss something??? anyone knows anything new???
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you need a full-blown .exe? Will an executable jar not work?
 
emilio rossi
Ranch Hand
Posts: 47
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
bacause:

a native compiled is way more faster (my softwares are a lot into huge archives operation so i feel the need...the need...for speed)
a native compiled is harder to decompile (in case one wish to distribute, not my case but...who knows)
a native compiled doesnt need a jre

to me it looks like the original sun's philosophy of one compiling----->one thousand run, is no longer smart,
since a large number of self made code developer can only handle java, they should think about a new philosophy write java--->compile as you like
and make a valid (freeware) native compiler
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
emilio rossi wrote:a native compiled is way more faster (my softwares are a lot into huge archives operation so i feel the need...the need...for speed)
Only in certain case. These micro optimizations aren't usually the real time-saver. Tuning your algorithm will probably increase your performance much more.
emilio rossi wrote:a native compiled is harder to decompile (in case one wish to distribute, not my case but...who knows)

True but it is still decompilable. If you are really worried about this you can use an obfusicator.
emilio rossi wrote:a native compiled doesnt need a jre

And thus doesn't have access to the vast amount of classes and functionality an jre provides.

emilio rossi wrote:to me it looks like the original sun's philosophy of one compiling----->one thousand run, is no longer smart,
since a large number of self made code developer can only handle java, they should think about a new philosophy write java--->compile as you like

I think you're missing information about how a jvm works. At runtime the bytecode will be compile to machine-language (aka native). The jvm will look at that the processor can do and if it can use those functions. That way the jvm will perform at its best on any supported processor. One way native applications can be faster is by using specific functionality of a processor which isn't recognized by the jvm. Of course there a other faster ways of doing the same (e.g. pointers) however since you want to compile from java to that you'll probably won't get any of those benefits.
 
Stephan van Hulst
Saloon Keeper
Posts: 7987
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java JIT compiler is very advanced. I don't think you will notice much of a performance difference between a Java program and a .exe.

So really, the only reason you want to go through the trouble of compiling your code separately for each platform is so the users don't need to have a JRE?

Instead, you can make an installer that downloads a JRE if the user doesn't have it installed yet.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12563
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
emilio rossi wrote:a native compiled is way more faster

that is a very bold claim with no evidence to support it.
 
emilio rossi
Ranch Hand
Posts: 47
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i dont distribute, so i dont care about customers compelled to download jre, but reading around this seems to be an issue for lots of people, as big as code protection needs,
the reason of writing java (and compiling as you like) is very for all the vast amount of classes and functionality apis can bring
thats why i think sun should think about it, java is easy, you can do hard things with 3 lines of code, but then you are a prisoner of java itself

at the end... who cares why one wish to compile java to native ... the point is:many people ask for, looks strange that there is just one solution around (and not a sun's one)
 
emilio rossi
Ranch Hand
Posts: 47
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
fred, the program startup is evidently faster, it is "visible" without a decimal seconds chrono
in my experience, i foun that for an archive operation that
open a word file, read data in it, operates with data, close, open a excel file read/write in it, close (everything with apache poi)
when you reach the 20-30 entryes time gap between java and native starts to get big
i dont know about processors or jvm works, i just talk for my experience.
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The startup may indeed be a little bit faster with a native application. Most of the jvm optimizations won't occur after x invocation. Because why would you optimize something that only gets invoked 2 in the lifetime of an application.

I'm curious how you measured that gap between jvm based and native.
 
emilio rossi
Ranch Hand
Posts: 47
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
making the same operations with the same files with both the java app and the native one...and noticing the gap
told you the more the files to be processed at once are the more you dont need a clock to notice the difference.

anyway , im astonished the situation is really like 3-4 years ago.If was mr.Oracle i'd prefere being cross-language than cross-platform
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!