Jar Files how to create them
#1
Posted 27 March 2005 - 06:49 PM
#2
Posted 28 March 2005 - 08:23 AM
#3
Posted 28 March 2005 - 11:21 AM
Created-By: 1.5.0 (Sun Microsystems Inc.)
Main-Class: RC5StatsFrame
please note the two <ENTER>s after the last attribute, they are mandatory, or it won't work.
#4
Posted 31 March 2005 - 10:45 AM
Seems strange that it can't hence my asking.
thanks for the reply either way
#5
Posted 31 March 2005 - 01:18 PM
Configure
> Options
> + next to Tools
> create Jar File
> somewhere on the right you can fill in the parameters
#6
Posted 31 March 2005 - 02:04 PM
Here's hoping!
#7
Posted 31 March 2005 - 02:57 PM
Here's hoping!

Exactly what I asked for. I used to use JBuilder and the one cool feature that I liked was that it could build complete self contained project jar files.
I now have a trick, have written a very simple .cmd file which has project related entries and I call this from withing jcreator to build my 'customised' project libraries.
#8
Posted 31 March 2005 - 06:05 PM
I now have a trick, have written a very simple .cmd file which has project related entries and I call this from withing jcreator to build my 'customised' project libraries.

You should post your .cmd file contents so people can use it too :P
#9
Posted 01 April 2005 - 12:09 PM

=============================================
I have encountered the same problem. Clearly it is malfuction on part of JCreator and has to be fixed as soon as possible!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#10
Posted 01 April 2005 - 01:49 PM
#11
Posted 05 April 2005 - 08:45 PM
Post that .cmd file, and Xinox... you need to fix up this problem - really bad. I tried making a new tool to create a jar file. The default user tool for creating a jarfile murdered my source code. I shouldn't need to be a ph.d to create a jar file, especially when JBuilder can make one out of a project just like that. If I were Xinox, I'd be very embarrassed this error had persisted long enough to weasle into a whole product release!
lordSaurontheGreat@gmail.com
JDK 6 Documentation - READ IT! LOVE IT! LIVE IT!
THOU SHALT GOOGLE BEFORE POSING THY QUERY!
If you're reading this you have given me control of your mind.
Why do accesses to your mind throw a "null pointer exception?"
#12
Posted 05 April 2005 - 09:05 PM
there is nothing wrong with the default jar creation script that is default in JCreator. I have used it for some time now and it works perfectly. It does exactly what it says it does: 'create a JAR file'.
I do not know how you have managed to destroy your source code using the jar tool, but the default JAR creation script is all right.
If you would like to know how to configure JCreator to create an executable JAR file, please read this topic for detailed instructions.
#13
Posted 05 April 2005 - 09:05 PM
Post that .cmd file, and Xinox... you need to fix up this problem - really bad. I tried making a new tool to create a jar file. The default user tool for creating a jarfile murdered my source code. I shouldn't need to be a ph.d to create a jar file, especially when JBuilder can make one out of a project just like that. If I were Xinox, I'd be very embarrassed this error had persisted long enough to weasle into a whole product release!

from what i can gather, all that JCreator does is call jar.exe with some parameters to make the jar file.
Its sun microsystems your rage should be directed at for eating the source code , not xinox :)
#14
Posted 06 April 2005 - 08:07 PM
Xinox should have a tool to create a jar file out of a project - a self-executing jar file. I shouldn't have to fool around with all this manifest nonsense! I mean, JBuilder found it such a small feature they didn't even bother to note it in the advertising (JBuilder 4). It can't be that difficult... I know I'm ignorant, but hey, it's real bliss. I don't want to learn how to create a manifest file!!! Forget saving the whales, save my ignorance!
lordSaurontheGreat@gmail.com
JDK 6 Documentation - READ IT! LOVE IT! LIVE IT!
THOU SHALT GOOGLE BEFORE POSING THY QUERY!
If you're reading this you have given me control of your mind.
Why do accesses to your mind throw a "null pointer exception?"
#15
Posted 09 April 2005 - 10:17 PM
in this file write:
Main-Class: MyPackage.MyClass
MyClass y the entry point to the jar file where the main method is. The text file must end with a new line or carriage return. This is very important or it won't work.
Save the file.
Now Configure->Options->+Tools->Create Jar File:
In the argumentrs field paste this:
cmf Manifest.txt $[PrjName].jar . .The dot after ...].jar must be pasted too.
That should work. It did work for me.
#16
Posted 10 April 2005 - 05:22 AM
1) telling me how. I would have never figured that out.
2) proving my point that it's really quite a bit to do just to make a jar file.
lordSaurontheGreat@gmail.com
JDK 6 Documentation - READ IT! LOVE IT! LIVE IT!
THOU SHALT GOOGLE BEFORE POSING THY QUERY!
If you're reading this you have given me control of your mind.
Why do accesses to your mind throw a "null pointer exception?"
#17
Posted 26 April 2005 - 05:26 PM
anyway,
save this as a file e.g. BuildProjectJar.cmd
goto %1
goto end
:Dummy
del %2\..\..\ProjectJars\Dummy.jar
jar cvf %2\..\..\ProjectJars\Dummy.jar -C classes /it/jrc/dummy -C ../Other/classes it/jrc/other
goto end
:LSAParser
del %2\..\..\ProjectJars\LSAParser.jar
jar cvfm %2\..\..\ProjectJars\LSAParser.jar manifest.mf -C classes /it/jrc/lsa
goto end
:end
Of course your directory structure may vary, I just have one dir where I jar all my projects, this dir then contains the latest builds.
Setup the tool in JCreator to run this file and take the project name, project dir as the parameters.
arguments: $[PrjName] $[PrjDir]
initial directory: $[PrjDir]
You do have to manually insert an entry into this file for each project (obviously)
Because you control the jar cvf line, you control the inclusion of the manifest (second example)
The only problem I found was the -C directive in the jar line, which does not do what you expect. -C does not 'change' directory, it only does it for the next file (or dir)
What I am trying to say is that if you want to get 2 class files from a different dir, you have to prefix them both with -C somedir otherwise you will not get what you want.
This here works for me, but is really very simple..
Oh, and the manifest file for nr 2 looks like
--
Manifest-Version: 1.0
Main-Class: it.jrc.lsa.ParserTest
--
3 lines!! the CR at the end is important
Erik
#18
Posted 20 September 2005 - 12:58 AM
i tried making the jar file using the manifest.txt and im pretty sure i did everything right.. is there something wrong with what is written there? i can't use a command line jar maker becuase this is for school and all the comps are monitored and deepfroze and crazy stuff..
help thanks
#19
Posted 20 September 2005 - 06:49 AM
that might be a problem, but I'm not sure.
if you renamed it MANIFEST.MF and got it in the jar file in the dir META-INF and it still doesn't work, please post your MANIFEST.MF file here

Help









