Reference to command line java utilities February 29, 2008
Posted by lemonpress in 1 cat, dev environment installation.add a comment
see http://neptune.netcomp.monash.edu.au/JavaHelp/howto/jar.htm
create compressed library archive (JAR)
jar cf archive_name.jar list-of-files
jar cf example.jar One.java Two.java Three.java
jar cf example.jar *.java
jar cf example.jar *
create java executable
javac * java compile all Java source files in the current dir
javac One.java Two.java Three.java
create an executable JAR
- create a text file that lists the “main” class e.g. mainClass.txt Main-Class: Three
- jar cmf mainClass.txt example.jar *.class
c - with modifications to the manifest file
m- name jar after main class as specified within mainClass.txt
f - including everything that matches the pattern *class
run executable JAR from command line
java -jar example.jar
Options
using libraries in your project February 29, 2008
Posted by lemonpress in 1 cat, java web dev.add a comment
xxx.jar – a library of useful classes packaged in a single archive file.
using libraries in your project is dead-easy.
- create classes, e.g. a collection of custom tag handlers
- zip them up using jar cf mytags.jar *
or jar cf mytags.jar list-of-files.class - copy mytags.jar into lib/ dir of another project (see More)
- use them
Tomcat Manager February 18, 2008
Posted by lemonpress in dev environment installation.1 comment so far
BTW: my credentials for Tomcat Manager are – admin admin
deployment on Tomcat February 18, 2008
Posted by lemonpress in dev environment installation, java web dev.1 comment so far
Start tomcat
C:\Tomcat55\bin\tomcat5w.exe or C:\Tomcat55\bin\tomcat5.exe
check if it is running: http://localhost:8085
Note that I set it up on port 8085 because JBoss has already taken port 8080, pluss a dozen of other ports. (Check in the notes which ports are taken – 8083…).
Drop .war or the unpacked project folder to C:\Tomcat55\webapps
check if URL works – that will be one of the welcome-files in welcome-file-list in web.xml
useful java commands February 18, 2008
Posted by lemonpress in 1 cat, java web dev.1 comment so far
First, navigate to the progectname dir
jar cvf projectame.war *
jar cf web-app.war *
(What’s the difference between cvf and cf?)
jar cf ear_app.ear web-app.war META-INF
(to deploy on JBoss)
* means “all files in this dir”