How do I call JAR which is in same folder as my java file? BUT I don't want to place this JAR file into JRE>lib>ext and also I don't want to create CLASSPATH for it.

do you want to run this JAR file or do you want to import it in your application so you can use it?

Import in my application and be able to use it. Easy portable with no need to do any changes to existing system(JAVA is expected to be installed)

i think you still need to define classpath or you can create a jar file (your classes + 3rd party jars) and run from it...

you can use eclipse or netbeans for creating jars easily

nope. the JVM will ONLY load classes it can find on its classpath (and that includes your application classes, if those aren't on the classpath it won't load them).

Best set up the classpath when running the JVM, that way it's local to that instance of the JVM.
That's achieved through the -cp commandline parameter to the Java runtime.

OK I will pack it in nice installer on the end which will check for all requerements. Thank you for helping

This question has already been answered. Start a new discussion instead.