-
jave to exe
hi. can anyone plz give me a link to a free prg that allows you to turn ur java code into exe? i'd rather not use jar files cuz ppl can still get my code. and besides, i dont have much experience with jar files anywyz.
thank you
-
-
I don't know about any programs, but I am pretty sure you can. However, any kind of executable (exe, bat, sh) would still have to make a call to 'java YourMainClass'
Also, why do you say that if you give jar files they can get access to your code????
-
Here's one tool Dunno if it's free.
http://www.duckware.com/jexepack/
-
well this is going to be embarrising. see, what i know about jar is that it's a zip file and can execute some code i write. so what's to stop a user from extracting the jar file and checking the code?
-
Jars are just a convenient way to store all your .class files into one file. Yes anyone can remove your class files and perhaps decompile them. That EXE pack program is probably what you're looking for, although I suspect that all it does is temporarily extract the .class files and run them normally.
-
am starting to pull my hair i have an X.java and X.class files in my NEW FOLDER in desktop.
i went to comp props, advanced, env variables and clicked new. it's the top one. i wrote PATH for name and C:\j2sdk1.4.2_03\ as the path. then i went to cmd prompt and went to my new folder in desktop. should be something like this: C:\Documents and Settings\Tareq.T\Desktop\New Folder. i typed jar cf nameoffile file/s
nameoffile: name of jar file. choose any name u want
file/s: the file/s that you would like to jar with a space
between each file
so in my case, i typed:-
jar cf x x.class x.java
the icon that was created in my NEW FOLDER was a white one. you know, the one where when you double click on it, it'll tell u that it cant find the app to open to this prg so either go to web to get the app or choose suitable prg from list. so i did that. then i went to C:\j2sdk1.4.2_03\bin and chose a javaw then i clicked okay and i got this error:
failed to load Main-Class manifest attribute from C:\Documents and Settings\Tareq.T\Desktop\New Folder\x
the env variable that i made gave me an idea. so i placed x.class and x.java in C:\j2sdk1.4.2_03\bin then i went to cmd prompt, went to C:\j2sdk1.4.2_03\bin and typed jar cf x x.java x.class
same result. nothing changed. i looked around on the internet but found now answer. oh, and btw, the icons of jar files that i found on the net while doing my search were either the same ones as word doc or quiet similar to it. in other words, the icons were different.
HELP!!!
-
if you're feeling a little adventurous gcc (the gnu compiler collection, which is licensed under the GPL) has had java support included for quite some time now I think
-
ya i checked it out a few days ago. but u see, the prb with me is that i need to know about jar files so that i can move on. i cant just leave it like this and then move on to something else. i gotta know why my jar files wont work. i gotta b able to use em to their fullest extent and control em all i like. so am kinda stuck now at thinking of why is it that i cant get it to work? check previous post
-
You can use any zip utility you like to create jar files. To run them, you need to make a manifest file (META-INF/MANIFEST.MF). You specify the main class in here, then you can just double-click to run.
-
okay can someone tell me the exact steps to create a jar file? cuz i dont know how to create a meta file. i thought that these were created with the jar file? nywyz, to stop any further confusion from arising, can someone plz tell me the exact steps to create jar files?
and i wana create them myself. not use any prgs
thanx
-
A jar file is just a zip file ending with '.jar'.
Here's a manifest file:
Code:
Manifest-Version: 1.0
Main-Class: Shapes
Created-By: aaa
'Shapes' is the class with the main method.
Create the manifest file using a text editor. Change the MainClass to your main class. Save it as 'manifest.mf' (make sure no '.txt' is added). Then create a folder. Put your java class files in there. In that folder create another folder called 'meta-inf'. Put 'manifest.mf' in there. Then highlight everything and put that highlighted stuff in a zip file. Rename it so it ends in '.jar'.
-
IT WORKED!!!! THANK YOU SOOO MUCH
if i knew that i had to do everythign myself, life would have been much easier. i thought that i'd learn the jar commands so that i can benifit but it turned against me : (
thanx again
-
Re: jave to exe
Originally posted by Wild Heart
hi. can anyone plz give me a link to a free prg that allows you to turn ur java code into exe?
you cant. java is intended as a program that can run on any platform. this means to turn it into an exe makes it windows only, which is against the whole idea. if you really think your windows-only code is worth protecting, write it in VB
i'd rather not use jar files cuz ppl can still get my code.
that's what obfuscation is for
and besides, i dont have much experience with jar files anywyz.
thank you
i have a link in my signature that will tell you nearly everything you want to know
-
Originally posted by Wild Heart
IT WORKED!!!! THANK YOU SOOO MUCH
if i knew that i had to do everythign myself, life would have been much easier. i thought that i'd learn the jar commands so that i can benifit but it turned against me : (
thanx again
you dont have to do everything yourself.. read the tutorial in my signature
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks