Java-Gaming.org    
Featured games (78)
games approved by the League of Dukes
Games in Showcase (426)
Games in Android Showcase (89)
games submitted by our members
Games in WIP (466)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Command line  (Read 1200 times)
0 Members and 1 Guest are viewing this topic.
Offline alexxz4

Junior Member


Projects: 1



« Posted 2007-10-26 02:54:30 »

Ok, suppose when i jar all my files i use command line and type this:

jar cf MyJAR.jar class1.class class2.class class3.class class4.class class5.class class6.class ...

is there a way to put that whole thing inside a file and execute that file? instead of typing that every time?

[ Motherload Unlimited looking for programmers ] [ Solitaire ]
Offline JonathanC

Senior Newbie





« Reply #1 - Posted 2007-10-26 02:58:30 »

Dump that into a .bat file (make one in notepad) and add "pause" as the second line so you can capture output.

- Jon
Offline GDX

Senior Newbie





« Reply #2 - Posted 2007-10-26 03:25:15 »

You might also consider using an IDE, like Eclipse, with Ant build files that you can write to do that kind of packaging (and a lot more <g>).
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline alexxz4

Junior Member


Projects: 1



« Reply #3 - Posted 2007-10-26 03:53:29 »

Thanx, Jon, it worked.
Quote
You might also consider using an IDE, like Eclipse, with Ant build files that you can write to do that kind of packaging (and a lot more <g>).
I use JCreator and it doesnt support jarring.

[ Motherload Unlimited looking for programmers ] [ Solitaire ]
Offline DzzD
« Reply #4 - Posted 2007-10-26 04:48:06 »

A simple way in Jcreator is to add a bat file as external tool: configure->option->tools->new->program than add a bat file like this:

makeJar.bat
1  
2  
3  
4  
5  
pushd
cd classes
jar cf output.jar *
popd
pause


once you have done it, simply add this external tools to your toolbar:
right click on toolbar->customise select categorie "Tools" drag first tools icon to your toolbar.

you may also use/customise this tools http://www.java-gaming.org/forums/index.php?topic=17584.0 to make exacly what you want as for example read filename from a txt file as requiered by your first post.

Offline dishmoth
« Reply #5 - Posted 2007-10-26 11:22:47 »

Ok, suppose when i jar all my files i use command line and type this:

jar cf MyJAR.jar class1.class class2.class class3.class class4.class class5.class class6.class ...

is there a way to put that whole thing inside a file and execute that file? instead of typing that every time?

You could use
1  
jar @arglist.txt

where "arglist.txt" is a file containing
1  
cf MyJAR.jar class1.class class2.class etc

spread over multiple lines if you like.  (See the jar tool documentation, e.g., http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/jar.html.)

But you may find that batch files may give you more flexibility.
Simon

Offline cylab

JGO Knight


Medals: 34



« Reply #6 - Posted 2007-10-26 13:30:38 »

Learning ant http://ant.apache.org/manual/index.html would give you a lot of flexibility and the accuired knowledge should be useful anyway, since it is pretty much standard for building/packaging java projects. I don't know use JCreator (and would advice using Netbeans or Eclipse), but there is at least some ant integration mentioned on the features page (apparently pro only). Also adding the ant-execution via configure->option->tools->new->program might always be an option.

Mathias - I Know What [you] Did Last Summer!
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (74 views)
2014-04-15 18:08:23

BurntPizza (68 views)
2014-04-15 03:46:01

UprightPath (80 views)
2014-04-14 17:39:50

UprightPath (65 views)
2014-04-14 17:35:47

Porlus (81 views)
2014-04-14 15:48:38

tom_mai78101 (105 views)
2014-04-10 04:04:31

BurntPizza (165 views)
2014-04-08 23:06:04

tom_mai78101 (261 views)
2014-04-05 13:34:39

trollwarrior1 (210 views)
2014-04-04 12:06:45

CJLetsGame (220 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!