jar files

is there any way of using the jar files in java without putting them in the classpath. I mean i want to use the files in the jar as a java file, is there ant way. would opening it with DJ decompiler help?
[211 byte] By [nan20_libraa] at [2007-10-3 9:47:23]
# 1

> is there any way of using the jar files in java

> without putting them in the classpath.

No.

> I mean i want to use the files in the jar as a java file, is there

> ant way. would opening it with DJ decompiler help?

Do I get you right: you want to include library classes into your project as source files? A decompiler would help, but for what reason?

quittea at 2007-7-15 5:04:20 > top of Java-index,Java Essentials,Java Programming...
# 2

if I understand right, you want to use the classes in a jar, without putting that jar in your classpath? yes, that can be done. load the classes yourself, not as daunting as it sounds: look up URLClassLoader, it should help you do this

although I may have misunderstood your question

georgemca at 2007-7-15 5:04:20 > top of Java-index,Java Essentials,Java Programming...
# 3
> is there any way of using the jar files in java> without putting them in the classpath.>> No.depends how you define "in the classpath", of course :-)
georgemca at 2007-7-15 5:04:20 > top of Java-index,Java Essentials,Java Programming...
# 4
> > is there any way of using the jar files in java> > without putting them in the classpath.> > >> No.> > depends how you define "in the classpath", of course :-)Strict :)
quittea at 2007-7-15 5:04:20 > top of Java-index,Java Essentials,Java Programming...
# 5
>> Strict :)then, no. by definition :-)usually, though, if someone is asking a question like this, by 'classpath' they mean the classpath environment variable, or the classpath as passed to the VM at startup.
georgemca at 2007-7-15 5:04:20 > top of Java-index,Java Essentials,Java Programming...
# 6
see the problem is "I want to run my code on some server and they do not have the following jar file or124.jar", but i want to use it . Now could anyone suggest how to acieve this
nan20_libraa at 2007-7-15 5:04:20 > top of Java-index,Java Essentials,Java Programming...
# 7
> on some serverDon't you have access to the directory WEB-INF/lib?> suggest how to acieve thisHow do you upload class files to that server? What kind of server is it?
quittea at 2007-7-15 5:04:20 > top of Java-index,Java Essentials,Java Programming...
# 8

i have a unix server where i have to put my code then the client will run it from my acctn folder, he will not give classpath variable

javac 朿lasspath

.:$ORACLE_HOME/jdbc/lib/classes12.zip:$ORACLE_HOME/md/lib/sdoapi.zip myCode.java

this is how the code is supposed to work, the 2 zip files mentioned only will be run & then myCode, so now how can i access any other jar file .

Message was edited by:

nan20_libra

nan20_libraa at 2007-7-15 5:04:20 > top of Java-index,Java Essentials,Java Programming...
# 9
> i have a unix server where i have to put my codeEdit: (Ok, no web application ... question deleted)
quittea at 2007-7-15 5:04:20 > top of Java-index,Java Essentials,Java Programming...
# 10
> javac 朿lasspath .:$ORACLE_HOME/jdbc/lib/classes12.zip:$ORACLE_HOME/md/lib/sdoapi.zip myCode.javaThe current directory is part of the CLASSPATH, so both compiling and running should work if you simply unjar or124.jar into the same directory where myCode.java is placed.
quittea at 2007-7-15 5:04:20 > top of Java-index,Java Essentials,Java Programming...
# 11
am sorry but i did not understand, its actually a problem of web appln only where i want to run the appln without specifying the jar files name in classpath.
nan20_libraa at 2007-7-15 5:04:20 > top of Java-index,Java Essentials,Java Programming...
# 12
*Confused*So it is a web application? In htdocs, create a directory named "WEB-INF/lib" (if not already present) and place this or124.jar in there ... done.
quittea at 2007-7-15 5:04:20 > top of Java-index,Java Essentials,Java Programming...
# 13
hey quitte vat u said wont work according to me coz i am giving a java for compilation using javac, if u see the command line i had given before, thus where do i keep the unjarred folders , i am not directly running the class file of myCode.java. Please could u clarify
nan20_libraa at 2007-7-15 5:04:20 > top of Java-index,Java Essentials,Java Programming...
# 14

> vat u said wont work according to me coz i am giving

> a java for compilation using javac, if u see the

> command line i had given before, thus where do i keep

> the unjarred folders , i am not directly running the

> class file of myCode.java. Please could u clarify

I gv teh ans b4: if u wanna compile, unjar or124.jar in2 teh same folder. If u wanna run it, also. If u hav a Servlet engine running it, put or124.jar in2 teh lib folder. If nothing applies, plz give more details abt ur environment.

quittea at 2007-7-15 5:04:20 > top of Java-index,Java Essentials,Java Programming...