The Artima Developer Community
Sponsored Link

Java Answers Forum
Seeking Application Resource Info...

3 replies on 1 page. Most recent reply: Apr 8, 2002 5:05 PM by Thomas SMETS

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
David Ramsey

Posts: 34
Nickname: dlramsey
Registered: Apr, 2002

Seeking Application Resource Info... Posted: Apr 4, 2002 3:07 PM
Reply to this message Reply
Advertisement
I am looking to write more stand-alone Java applications. Most of my prior work has been in a servlet container environment that has protected me somewhat from the vagueness of the underlying OS, the classpath, etc.

For example, one problem that I am seeing is that creating a jar file with an executable Main-Class defined but which also depends on other jars does not seem to work unless those other jars are in the same directory as the jar being executed.

What I am looking for is not specifically an answer to this but suggestions on web sites, books, and other material that would assist me in making the jump from writing web appplications (.wars) to stand-alone .jars. Things like how classpath is managed when running "java -jar myapp.jar" don't seem to be well documented and I'm not finding many resouces to explain what I am seeing.

Thanks in advance for any suggestions!

-- Dave Ramsey


Lynn Hollerman

Posts: 67
Nickname: gmholler
Registered: Mar, 2002

Re: Seeking Application Resource Info... Posted: Apr 5, 2002 6:52 AM
Reply to this message Reply
Dave,

You might want to look into the Java glossary at
http://www.mindprod.com/jgloss.html
- this has proven to be an invaluable resource for me for info for stand-alone Java applications.

Hope this helps!

Lynn.

David Ramsey

Posts: 34
Nickname: dlramsey
Registered: Apr, 2002

Re: Seeking Application Resource Info... Posted: Apr 8, 2002 9:49 AM
Reply to this message Reply
Thanks for the reference. That was the first place that I found that explicitly stated that running java -jar someapp.jar ignores the defined classpath.

What I am wondering then is how apps that I've seen written in Java, and which come with numerous additional jar files external to the main app jar file manage to load and access those classes.

I'm sure I can muddle my way through this monkeying perhaps with the ClassLoader or the java.class.path system property (or both) but I was really hoping to find a useful discussion of this issue along with suggestions from others who had to trailblaze this way already.

Thanks again though! That's a useful URL!

Thomas SMETS

Posts: 307
Nickname: tsmets
Registered: Apr, 2002

Re: Seeking Application Resource Info... Posted: Apr 8, 2002 5:05 PM
Reply to this message Reply
Apparently the crimson.jar allows you to dynamically load jars in a Directory (see how JBoss works).
ANT also allows you to dynamically create a classpath.

thomas,
tsmets @ lautre . net

Flat View: This topic has 3 replies on 1 page
Topic: Serializing classes and saving objects in files throught applets Previous Topic   Next Topic Topic: Arrays in Conways Game of Life

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use