Skip to main content

probable bug (class path and manifest file) where to report?

1 reply [Last post]
erikn
Offline
Joined: 2006-06-26
Points: 0

Where to report a Java bug now? I can't find it on java.net. Here is the bug:
(Dec 14 2010) When creating a jar file, if you use JarIndex (option i for jar command, or with ant the index="true" attribute) this will break the ability to find  jar files via the manifest!  This seems like a bug.
  Here is the manifest as extracted with jar xf
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.1
Created-By: 1.6.0_22-b04-307-10M3261 (Apple Inc.)
Main-Class: com.myphysicslab.simlab.applet.Lab
Class-Path: Simulation.jar Roller.jar Engine2D.jar

  If I have index="true", I am still able to run my application by setting the classpath explicitly like this:
  java -classpath 'Simulation.jar:Lab.jar:Roller.jar:Engine2D.jar' com.myphysicslab.simlab.applet.Lab
  
  But doing java -jar Lab.jar fails like this:
     [java] starting MyPhysicsLab 0.95.0_02h Oct 20 2010 browserMode false
     [java] Exception in thread "main" java.lang.NoClassDefFoundError: com/myphysicslab/simlab/roller/RollerBuilder1
     [java] at com.myphysicslab.simlab.applet.Lab.startSim(Lab.java:417)
     [java] at com.myphysicslab.simlab.applet.Lab.init(Lab.java:272)
     [java] at com.myphysicslab.simlab.applet.Lab.main(Lab.java:164)
     [java] Caused by: java.lang.ClassNotFoundException: com.myphysicslab.simlab.roller.RollerBuilder1
     [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
     [java] at java.security.AccessController.doPrivileged(Native Method)
     [java] at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
     [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
     [java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
     [java] at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
     [java] ... 3 more
  So java is able to find the Lab class and the main() method, but can't find classes in other jar files.
  
  I was tearing my hair out trying to figure out what was wrong with my manifest file or what else could be wrong.  I finally got a clue from this link:  
http://ant.1045680.n5.nabble.com/Manifest-MF-classpath-is-in-wrong-forma...
  "In the META-INF directory the auto generated file INDEX.LIST that lists all 
  the packages for the jar that is being built and with INDEX.LIST in META-INF 
  directory , java - jar jarFile.jar ignores Class-Path attribute and looks in 
  the packages listed in the INDEX.LIST."

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
anthony_p
Offline
Joined: 2006-07-24
Points: 0

erikn wrote:
Where to report a Java bug now? I can't find it on java.net.

Java bugs should be reported at http://bugs.sun.com/