0

I am in the final step of my application release and so creating jar, called App.jar. I have other jars on which App.jar is dependent, so I rather included it within App.jar. When trying to run, it works if App.jar is put into the folder of the main project. However, when put outside it (for example on the dekstop), it does not work completely, meaning that some GUi components are not displaying. My question is:

Besides other jars on which my App.jar is dependent, can it be dependent on some other files or under some other conditions?


EDIT:

I am working in Eclipse, to build jar I just exported it and chose the option "packaged required libraries into generated JAR", which put all the jars I need to run into App.jar. My MANIFEST.MF then looks like this:

Manifest-Version: 1.0
Rsrc-Class-Path: ./ JTattoo.jar plugin.jar docking-frames-common-1.1.1
 -SNAPSHOT.jar jl1.0.jar swt-3.7M5-win32-win32-x86.jar worldwind.jar a
 ccess-bridge.jar sunpkcs11.jar looks-2.0.1.jar tools.jar OfficeLnFs_2
 .7.jar jce.jar jna_WindowUtils.jar dom4j-2.0.0-ALPHA-2.jar junit-4.5.
 jar rt.jar mysql-connector-java-5.1.21-bin.jar sunmscapi.jar glasslib
 .jar resources.jar jxl.jar dnsns.jar sunec.jar jogl.jar mp3spi1.9.4.j
 ar docking-frames-core-1.1.1-SNAPSHOT.jar DJNativeSwing.jar tritonus_
 share.jar dom4j-2.0.0-ALPHA-2-sources.jar zipfs.jar MozillaInterfaces
 -1.8.1.3.jar jfr.jar DJNativeSwing-SWT.jar gluegen-rt.jar jaxen-1.1.1
 .jar gdal.jar localedata.jar jna-3.2.4.jar charsets.jar sunjce_provid
 er.jar jsse.jar jaccess.jar
Class-Path: .
Rsrc-Main-Class: org.cnstar.wiki.app.GreatPlaces
Main-Class: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader
SplashScreen-Image: images/splash_screen.png
MichalB
  • 3,281
  • 6
  • 32
  • 46

1 Answers1

1
  1. You should set the classpath properly to include all the jars required.

  2. Yes there can be more jars dependency due to transitive dependency. Your App.jar may be dependent on a jar, which may be dependent on another jar. Using Maven you can be away from all such worries as it automatically downloads all the dependencies.

Juned Ahsan
  • 67,789
  • 12
  • 98
  • 136