Jar to exe is *really fragging simple* - read on...

Step 1) compile this code to xjar.bin
int main(int argc, char *argv) {
    return system("javaw -jar xjar.exe");
}step 2) cat xjar.bin yourapp.jar > xjar.exe
viola, it's an exe, it can have a pretty icon, a user can double click to run, no .bat files, AND it's cross platform! because you can legally prepend data to a zip file, the exe is merely a header, for other platforms you can run the normal .bat / .jar way. (you may need to do zip -F to fix though, the kaffe VM doesn't like headered zips, sun's is ok with it though)
===
My knowledge of C was really basic a few months ago, and has rotted since, methinkst it should only take another couple of lines to do
"javaw -jar %s", args[0]
to allow renaming of the exe, but my many attempts all segfault, can someone here add to it?

still need a JVMWherever you go you still need libraries - and compare
the size of 8MB JRE download to all the gigabytes of
stuff in /usr/lib
The most common reason is because they want the appto be faster, this solution,
at least on start up is slightly slower.It starts slightly slower, and after that JIT takes
care of the rest. With the exception of array use
(with enforced bounds checking each access) and the
first time a each class is loaded, JITted programs can
run faster than CI didn't claim that it would run faster if actually compiled. I did however say that is what people think when they are looking for a compiled solution. I doubt that they will think that your solution meets that need.
>
>
The second most common reason is to "protect" thecode. This doesn't help
with that either.A) most people wouldn't even attempt to decompile
any .exe file, unless they know its a jar in disguise
B) Obfuscation helps a lot, even if it isn't perfect
C) C binaries can be decompiled to C source, just like
java. I can't remember the program (dcc?), it's still
in alpha and the author got a job and moved on before
finishing it, but it still works for small simple
apps.
D) Writing / editing parts in jasmin tends to screw up
decompilers, and they either crash or resort to
spewing bytecode mnemonics
Anywho, the point is is solves some of the problems,
without creating any new ones (unless you count the
nanoseconds for a 5KB C prog to start as a
problem...)...Again I didn't say that I wanted to do this. I argue against using any methods designed to protect code. But other people do. The slight hiding that this achieves might be what they want. Or not.

Similar Messages

  • Has anybody used jsmooth tool to convert .jar to .exe?help needed

    Hello,
    has anybody used jsmooth tool to convert .jar to .exe if so please let me how to do because i couldnt do using the user manual since its not clear pls if any one uses it please let me know the procedure to do its really urgent plsssss

    Prabhav (guest) wrote:
    : We were looking for a tool from which we could directly embed
    : PL/SQL codes to our pre built HTML pages. When I came across
    : WebAlchemy, developed by the Aussie pro, I thought that was
    the
    : thing I wanted. I am using the beta version 2.1 of WebAlchemy
    : but I am having problems converting my pl/sql embedded Html
    file
    : into web PL/SQL cartridge as the Alchemy cannot convert few
    : attributes properly.
    : Has any body used it and have solution? Is there any other
    : product like this on the web or market? Pleaes advice, only
    : thing I want is to let my HTML be able to listen to Pl/sql
    : procedure and generate dynamic contents without use of CGI and
    : JavaScript.
    : Please suggest anything u can.
    Hi,
    I have also used Web Alchemy, but have never come across a
    production version (I tried also). It's a shame it was never
    completed, as it only seems to support HTML v2.
    Regards
    Toby.
    null

  • Convert Jar to Exe

    Hi,
    I would like to convert my Java application to a single .exe file. I have read through many posts highlighting the advantages and disadvantages.
    The reason for this is that I would like to offer my application as a commercial software and clearly I do not wish to provide users with all classes and jars...in other words, how does one go about protecting the software against pirate use?
    what would be the best tool to create this 'real' .exe file that contains all it needs to run on any (windows) maching without the need of having a Java runtime installed?
    My idea is to first use some obfuscator and then convert the whole thing into an .exe.
    thanks

    I don't know... IBM doesn't seem to worry much about this, they sell me RAD and don't bother with any of that protection business. What bad thing could happen if somebody saw your code? Remember that people don't need to decompile your classes to pirate them, they can just make copies of the classes.

  • JAR to EXE or executable JAR conversion

    Greetings all
    I have a jar file placed in my java\bin folder. i want to make it into an executable .exe file. if not that i want to execute it without going on command line and writing
    java -jar MyJar.jar
    is there any solution?
    somebody told me to make a .BAT file and run it..i dont know anything about BAT files...is there any convertor that may convert my Jar into .EXE file keeping icons + images in my program intact?

    rabia409 wrote:
    Greetings all
    I have a jar file placed in my java\bin folder.Why? It should not be there?
    i want to make it into an executable .exe file.Please forget that for a moment and tell us what your goal is (instead of what you think the correct approach is).
    if not that i want to execute it without going on command line and writing
    java -jar MyJar.jarSo you want to double-click it and it should run?
    If your system is set up correctly and "java -jar MyJar.jar" works, then double-clicking it should start it was well.

  • I can no longer open excel documents in my doc to go app. Error message simple reads can not open attachment. And the attachment is now a winmail.dat

    I can no longer open excel documents in my doc to go app. Error message simple reads can not open attachment. And the attachment is now a winmail.dat

    winmail.dat files usually mean the email has been sent in rich text format - you could either the person who sent it to send it in a different format e.g. plain text or HTML, or there are a few apps in the store that support it (search for winmail.date in the store).
    winmail.dat files : http://support.apple.com/kb/TS1506

  • MIO 6601 Counter, Perform Buffered Read and Simple Read

    I have an application written in C++ where I would like to use the 6601 as the time base for all of the boards, so I would like to be able to query the current value of the counter. I also have a external signal that I want time tagged in the buffer. I have used example programs for the Simple Read and the Buffered read and they both work successfully individually.
    If I try and combine them by setting up the counter with the following statement:
    iStatus = GPCTR_Set_Application(iDevice, ND_COUNTER_3, ND_BUFFERED_EVENT_CNT);
    and try to read the current value of the counter with:
    iStatus = GPCTR_Watch (iDevice, ND_COUNTER_3, ND_COUNT, puiCurrentTime);
    I always return a 0 for puiCurrentTime.
    Can
    I do both with a single counter? If not can I synchronize two counters one setup for the buffered read the other for the simple read.
    Thanks

    The second NIDAQ function call (GPCTR_Watch) will not work with Buffered Acquisition, because it is designed for simple read only. That might be the reason why puiCurrentTime always returns a zero.
    Regarding the second issue, you can do both tasks with a single counter, by configuring it as buffered first, and completing the operation, and then configuring it as single, and completing also the operation. Nevertheless, there is no way to configure it as buffered and work with it as single reader, or viceversa. You must use two for performing an operation such as that. Thus, if you want to synchronize both of them, I would suggest you to read the following document which talks about it.
    Well, I hope all of this info is helpful for you.
    Aguila
    Attachments:
    Multicounter_Synchronization_App_Note.doc ‏55 KB

  • How do i convert .jar to .exe?

    how can i convert jar files into .exe ,is there any tool to make that if so plss let me know its urgent

    Mikado wrote:
    ..how do i convert my .jar file to .exe fileUse Java Web Start to launch the Jar file direct from the net. It provides a slick, easy and secure route to 'one click' installation. JWS also provides many other goodies, like cross-platform support, splash screens, auto-update, desktop integration and more..
    BTW - when asking a question, do not forget to add a question mark (?) at the end.

  • Javafx JAR to .exe(windows) or .app (MAC)

    hi,
    Anybody has any idea how can i import my javafx application to an installation file for MAC or Windows?
    For example, MAC has a jar bundler app which convert java jar to .app files for MAC.
    I tried with it, but it fails, i have no idea how to make it run javafx jar files.

    I've looked throughout the forum but I've only found
    how to call an executable from within the java code,
    but not convert it into an exe.
    And about googling it, I found few (maybe not using
    the correct keywords, any suggestion?), and they
    don't quite work well, so, just asking if any of you
    have had success with one and, what is the name of
    it.
    Thx.can't have looked very far, then. the definitive answer to this question has been posted several times, quite recently
    the real question, though, should be "do I want to bind my nice portable java code to a particular platform?"

  • Newbie: Simple Reads, Transactions, Pooling and Code Form

    I am currently refactoring a set of code (assembly) called by a windows service that provides persistence to an Oracle DB (DataAccessComponent). The motivation for the request to perform this work was to reduce connections to the Oracle DB.
    The most salient cause I believe of the excessive connections is the intermingling of ODP and the MS.Net Oracle provider. This has been removed and all code now utilizes ODP.
    My problem: The DataAccessComponent undergoing a refactor itself depends (half of the code access methods) heavily on another external assembly that was created to manage all access to the Oracle DB (DataManagment). This DataManagment component Requires a call to its own BeginTransaction() method. This BeginTransaction() behavioral facade then proceeds to create a new OracleConnection then OracleTransaction and adds it to an internal STACK. From what I can tell this stack is and its Transactions are initially independent of an OracleCommand. Then when a Command is executed in this DataManagment component it checks its internal state/stack for an active Transaction and either: joins the currently executing internally-referenced Transaction if it has not been committed or POPs the STACK for an available Transaction. The ostensible reason (assumptions) for this architecture are a) a joined Transaction only utilizes one Connection to the Oracle DB - thereby minimizing connections and b) an attempt to execute two Transactions on a single Connection will (reportedly) cause an exception and c) served as a basis for a home-grown code data access code generation tool.
    The side effects (as I see them) of utilizing this external DataManagment assembly (with its Transaction stack) are that even simple ExecuteReader() (database read only) must participate in a Transaction (indeed create one if none exists). Furthermore, in my more familiar MS SQL .Net provider world, the general rule I believe is that the .Net provider takes care of caching the Connection and two separate Transactions that attempt execute a command at roughly the same time (overlap) will not throw an exception. Furthermore, I am not accustomed to wrapping simple database reads in Transactions - seems like overkill to me.
    My preferred method of performing reads and writes to Oracle would be to utilize what I know of ADO styled data access in general:
    using(OracleConnection conn = new OracleConnection(ConnectionString))
         using(OracleCommand cmd = new OracleCommand(SqlStatementString,conn))
              cmd.CommandType = CommandType.Text;
              cmd.Connection.Open();
              using(OracleDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection))
                   while(rdr.Read())
                        //Do something with reader data
                   rdr.Close();
         //Should I call conn.Close();
    using (OracleConnection conn = new OracleConnection(ConnectionString))
         using (OracleCommand cmd = new OracleCommand(OraclePackageString, conn))
              cmd.CommandType = CommandType.StoredProcedure;
              //cmd.Parameters.Add(...);
              //cmd.Parameters.Add(...);
              cmd.Connection.Open();
              using(OracleTransaction tran = cmd.Connection.BeginTransaction())
                   try
                        cmd.ExecuteNonQuery();
                        tran.Commit();
                   catch
                        tran.Rollback();
                        //Handle exception
         //Should I call conn.Close();
    So I have done some research and know that Transactions are scoped to connections. Do that mean that if the above two routines execute simultaneously they will a) create two separate connections? b) throw an exception?
    Furthermore, if I call two of the second routines (Transacted) simultaneously with I a) get an exception? b) create two separate connections?
    And lastly, if I am calling a bunch of the first type of routine above (non-transacted, read-only) will I a) create a new connection with every call? b) use the same ODP provider cache connection?
    Also most of these access routines that do writes, only update a single table and row. If that’s all that is being done and I am not participating in Save Points for rollback do I need a transaction on the writes at all? (Given that I would need to respond to an exception as part of the application logic)
    I am not familiar with Oracle connection pooling so I am also not sure if I should be implicitly calling Dispose() on the Connection object(s) above -> which in turn calls Close() or even calling close manually. I read in a post on these boards that if you are running connection pooling you should leave the connection open?
    Any help much appreciated... I
    Thanks, Brad

    I may not be able to answer all of your questions but I can certainly attempt to answer your questions related to connection pooling. Based on the code samples you posted, I do not see any threading issue with connection or transaction since you are always creating a new connection object and always a new txn.
    Once you are done with the connection, you should call conn.Close() so that the underlying session returned to the ODP.NET connection pool as you need not keep connection open to utilize ODP.NET connection pooling. Obviously, in your sample, you are using the "using" clause which will implicitly dispose the connection object hence you do not need to call Close here as Dispose should close the connection.

  • Jar To Exe

    Hi All
    I have a .jar file.Now i want to create .exe.How can i make it.
    Plz Help me

    Vijayjava wrote:
    Hi All
    I have a .jar file.Now i want to create .exe.How can i make it.
    Plz Help mehttp://launch4j.sourceforge.net/
    probably that's what you are looking for
    Regards

  • I want to update to 3.6.4 but don't want to risk the problems container.exe is causing that am reading in this forum.

    There are quite a few having problems related to container.exe due to updating to 3.6.4 as I see from this forum.
    I don't have video problems, never did, and sounds like if I update, it's going to start having problems..
    It is possible for ff to make a patch so that we can have a user friendly and safe disable (without system code?)
    I appreciate firefox very much and thank you developers for your hard work and care.
    I just don't want to update until this is stable..too risky..
    Thanks!
    == Operating system ==
    winvist

    Also be aware that if you add a quiz to the project, that the drag and drop and quiz affect each other.
    In a way we have been cheated into thinking that is also a learning tool for repeated attempts. With a quiz in the project it does not work.
    I also tried it without the quiz. When learners now use it, the drag and drop will "hang" at times. EMBARRASING when a client phones you with a stuck learning session!!
    I have spent hours with the online Adobe dudes. It some or other "buG".
    "BUG" is IT code for "we designed something but did not test it well enough and now we pretend that it is some mysterious organic organism that is maliciously undermining our design"  

  • Acrobat Elements.exe memory could not be read

    Every time I right click on either a Word or Excel document and select Convert To PDF, it immediately gives the error:
    Acrobat Elements.exe - Application Error - The instruction at "xxxxxxx" referenced memory at "xxxxxxx".  The momory could not be "read".
    Has anyone come across this and know how to resolve?  I have uninstalled and reinstalled Acrobat 8 Standard and ran all of the updates as well as ran a repair and all of the updates for MS Office.  It happens on multiple machines running Office 2003 and 2007.
    Thanks

    I think AE is a different forum... start here http://forums.adobe.com/community/acrobat

  • Help with simple div placement, because it really isnt simple

    Hello all,
    I am new to edge, but not adobe.
    I have a webpage with a 100% header width, but body is 1000px wide. I want to add a rectangle in grey to fade out to reveal the header, i got it to work but edge
    will not let me assign it to 100%, or the max width of 1200px. it also keeps misplacing it. i try to manually adjust and it just completely destroys my layout. pressing up and right moves it left and down, then just down after, even if i press the correct arrow keys. Why is it so hard to do such a simple thing!!
    please help. very fed up now.

    Try this:
    sym.$("Stage").css("margin", "auto");
    sym.$("Stage").css("width", "1000px");

  • 100% CPU Utilization by svchost.exe evidently due to Acrobat reader & Adobe players

    I have been working on a PC that was rendered inoperable because svchost.exe pegged the CPU @ 100%. After working on it for a couple of hours, I reformatted the HD & restored the OS. In the process of re-installing programs, when I got to the Adobe products (Flash, Shockwave, Air & Acrobat reader) again svchost.exe was pegging the CPU @ 100%. So I removed the 4 above mentioned & restored the PC to just before the installation, and the PC was back to normal. Next I re-installed Acrobat reader, and svchost.exe pegged the processor again at 100%. After removing Acrobat reader & going back to the restore point, everything was normal again. The next time I tried just the Flash & Shockwave players, and pegged again. Would draw the same conclusion as me that there is a problem with the Adobe downloads? I have another PC on my bench that seems to have the same problem. If there is anyone from Adobe that would like to address this issue please contact me. [email protected]

    This is a user-to-user forum, and it is very unlikely that someone "from Adobe" will contact you. It is not recommended that you post your email address in a public forum, as it will only attract spambots.
    The fact that svchost is using high CPU resources (without any of the Adobe products actually running) indicates to me that you have something in your startup items that triggers svchost usage. Examine your startup list and eliminate anything that could doing that.

  • Any free .jar to .exe converters / builders?

    I've found several installers online, but they are all ridiculously expensive for me (student wanting to share his open-source projects with the community). I've found the .jnlp files pretty nice-to-use, but I'd also like to deploy some applications with installers for Windows (Mac and Linux would be a plus, but is not necessary).
    Is there any FREE solution to my problem?

    Well they don't have to throw the advertisements into
    the actual exe. That's just retarded. Spam the
    website, spam the interface, don't spam the exe.Nobody's ever going to look at the interface or the website, and there is no better means to make you pay for the product, otherwise, your customers won't pay for yours.

Maybe you are looking for