Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.help > #2080 > unrolled thread
| Started by | gearss8888@gmail.com |
|---|---|
| First post | 2012-09-08 00:21 -0700 |
| Last post | 2012-09-08 20:35 -0700 |
| Articles | 6 — 5 participants |
Back to article view | Back to comp.lang.java.help
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
| From | gearss8888@gmail.com |
|---|---|
| Date | 2012-09-08 00:21 -0700 |
| Subject | which folder I should these jar files to? |
| Message-ID | <4c945d47-896e-42af-881e-329ff2218153@googlegroups.com> |
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? best regards, Liwen ------------- the following is the import codes: import chrriis.dj.nativeswing.swtimpl.NativeComponent; import chrriis.dj.nativeswing.swtimpl.NativeInterface; import chrriis.dj.nativeswing.swtimpl.components.JWebBrowser; import chrriis.dj.nativeswing.swtimpl.components.WebBrowserAdapter; import chrriis.dj.nativeswing.swtimpl.components.WebBrowserEvent;
[toc] | [next] | [standalone]
| From | Joerg Meier <joergmmeier@arcor.de> |
|---|---|
| Date | 2012-09-08 11:11 +0200 |
| Message-ID | <1ut565d1fniau.bzzhdv0pm309$.dlg@40tude.net> |
| In reply to | #2080 |
On Sat, 8 Sep 2012 00:21:16 -0700 (PDT), 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? > best regards, If you just want to run a Java program, then in most cases, the library jar's should go into the same folder as the application jar. Liebe Gruesse, Joerg -- Ich lese meine Emails nicht, replies to Email bleiben also leider ungelesen.
[toc] | [prev] | [next] | [standalone]
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Date | 2012-09-08 16:57 -0700 |
| Message-ID | <bf114c92-a742-4ed1-adca-6ca266b0a68f@googlegroups.com> |
| In reply to | #2081 |
Joerg Meier wrote: > gearss8888 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? > > If you just want to run a Java program, then in most cases, the library > jar's [sic] should go into the same folder as the application jar [sic]. How will that help? Where the JARs go depends on how you run the program. If you run it with java <options> <class> then the JARs go wherever you want, provided you specify the classpath to include the JARs from that location. For example, to make Joerg's suggestion actually work, you'd need something like: java -cp ./* com.foo.bar.Main Without the correct specification of the classpath, Joerg's suggestion is useless. If the program runs with the "-jar" option, then the JARs must go in the location specified by the program JAR's manifest, relative to the directory of the program JAR. Command-line and environment- variable classpath specifications are ignored. This is covered in the Java tutorials, which surely you are studying. -- Lew
[toc] | [prev] | [next] | [standalone]
| From | Joerg Meier <joergmmeier@arcor.de> |
|---|---|
| Date | 2012-09-09 11:54 +0200 |
| Message-ID | <ta0ylu8d6m9i.1lekkx2247cn8$.dlg@40tude.net> |
| In reply to | #2082 |
On Sat, 8 Sep 2012 16:57:00 -0700 (PDT), Lew wrote: > Joerg Meier wrote: >> gearss8888 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? >> If you just want to run a Java program, then in most cases, the library >> jar's [sic] should go into the same folder as the application jar [sic]. > How will that help? > Where the JARs go depends on how you run the program. If you run it with > java <options> <class> Then you have no application jar, and my advice is obviously not tailored to this situation. I would however question how many applications are distributed as .class files. That would seem like a rare edge case. > If the program runs with the "-jar" option, then the JARs must go > in the location specified by the program JAR's manifest, relative > to the directory of the program JAR. Command-line and environment- > variable classpath specifications are ignored. Which, like I said, would most likely be "." for the typical application. Liebe Gruesse, Joerg -- Ich lese meine Emails nicht, replies to Email bleiben also leider ungelesen.
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2012-09-08 19:51 -0700 |
| Message-ID | <801o485brdgml9fq671s74r3bi7ngc422r@4ax.com> |
| In reply to | #2080 |
On Sat, 8 Sep 2012 00:21:16 -0700 (PDT), gearss8888@gmail.com wrote, quoted or indirectly quoted someone who said : >I am new in Java, I want to run a Java program, it needs three jars: swt-3.= >6M3-win32-win32-x86.jar=EF=BC=8CDJNativeSwing-SWT.jar,DJNativeSwing.jar, I = >get them, but I donot know which place I should put them into, can someone = >help me? >best regards, see http://mindprod.com/jgloss/classpath.html You might put them in the ext directory, or in some other directory, and add the jars (not the containing directory) to the path. -- Roedy Green Canadian Mind Products http://mindprod.com A new scientific truth does not triumph by convincing its opponents and making them see the light, but rather because its opponents eventually die, and a new generation grows up that is familiar with it. ~ Max Planck 1858-04-23 1947-10-04
[toc] | [prev] | [next] | [standalone]
| From | markspace <-@.> |
|---|---|
| Date | 2012-09-08 20:35 -0700 |
| Message-ID | <k2h2q8$ucb$1@dont-email.me> |
| In reply to | #2080 |
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.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.help
csiph-web