Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #2084

Re: which folder I should these jar files to?

From markspace <-@.>
Newsgroups comp.lang.java.help
Subject Re: which folder I should these jar files to?
Date 2012-09-08 20:35 -0700
Organization A noiseless patient Spider
Message-ID <k2h2q8$ucb$1@dont-email.me> (permalink)
References <4c945d47-896e-42af-881e-329ff2218153@googlegroups.com>

Show all headers | View raw


On 9/8/2012 12:21 AM, gearss8888@gmail.com wrote:
> I am new in Java, I want to run a Java program, it needs three jars:
> swt-3.6M3-win32-win32-x86.jar,DJNativeSwing-
> SWT.jar,DJNativeSwing.jar, I get them, but I donot know which place I
> should put them into, can someone help me?


I usually put Jar files in a common location like:

C:/Users/Me/Development/Libs/swt/swt-3.6M3-win32-win32-x86.jar
C:/Users/Me/Development/Libs/swt/DJNativeSwing.jar
C:/Users/Me/Development/Libs/swt/DJNativeSwing-SWT.jar

Then I set those Jars as libraries in my IDE, or in an ant properties file.

Example:

<project name="MyProject" default="dist" basedir=".">

   <property name="libs" location="C:/Users/Me/Development/Libs/swt/*"/>

   <target name="compile" depends="init" >
     <!-- Compile the java code from ${src} into ${build} -->
     <javac srcdir="src/" destdir="dest/" classpath="${libs} />
   </target>

</project>

(The above wasn't syntax checked or tested.)

Using the classpath environment variable is kind of newbie-ish, and 
using the ext directory is downright dangerous, imo.  Best to learn to 
separate the libraries need for each project.  Trying to copy every 
single Jar file you might need into the ext directory is a sure way to 
have a train wreck at some point.

Back to comp.lang.java.help | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

which folder I should these jar files to? gearss8888@gmail.com - 2012-09-08 00:21 -0700
  Re: which folder I should these jar files to? Joerg Meier <joergmmeier@arcor.de> - 2012-09-08 11:11 +0200
    Re: which folder I should these jar files to? Lew <lewbloch@gmail.com> - 2012-09-08 16:57 -0700
      Re: which folder I should these jar files to? Joerg Meier <joergmmeier@arcor.de> - 2012-09-09 11:54 +0200
  Re: which folder I should these jar files to? Roedy Green <see_website@mindprod.com.invalid> - 2012-09-08 19:51 -0700
  Re: which folder I should these jar files to? markspace <-@.> - 2012-09-08 20:35 -0700

csiph-web