3

as far as I can see, both craftbukkit and UHC are on the buildpathenter image description hereI decompiled a jar, imported the files into eclipse, and edited a few key java files. Whenever i try to export however, it gives me a

"JAR creation failed. See details for additional information. UHC-2.4.1/META-INF/MANIFEST.MF was replaced by the generated MANIFEST.MF and is no longer in the JAR. uk/co/eluinhost/UltraHardcore/features/core [in UHC-2.4.1] is not on its project's build path Unable to get package fragment root: UHC-2.4.1/uk/co/eluinhost/UltraHardcore/features/core/GoldenHeads.java uk/co/eluinhost/UltraHardcore/features/core [in UHC-2.4.1] is not on its project's build path" error. 

I have searched far and wide for a solution, but have nor found one. I have tried refreshing the project etc, and all the necessary libraries are specified. Please help? Additional information: If I edit any other class (just add a space then delete it and then save) that class gets added to the error message as well.

  • This is probably not an issue with jar creation but compilation: source has to be compiled before being jarred. Are there any red X's in package explorer or the error view? –  Sep 11 '13 at 01:22
  • there are no red x's, look at the picture –  Sep 11 '13 at 23:32
  • Right you are user, I thought that was Navigator view for some reason. –  Sep 13 '13 at 01:22

3 Answers3

12

I had the same issue. I noticed that all of the files that were listed as "not on the project's build path" were open for editing in Eclipse. Once I closed all of the open files, I was able to export the jar.

I assume they are locked for editing and so not exportable.

Tom Cronin
  • 121
  • 1
  • 3
0

There are two issues:

  1. It looks like you have the MANIFEST.MF file (UHC-2.4.1/META-INF/MANIFEST.MF ) so just when you are exporting the jar file select the option for existing manifest file and point it to UHC-2.4.1/META-INF/MANIFEST.MF .

  2. You are missing a jar file (download the UHC-2.4.1.jar from here and and add it to class path.

I know you wrote that you have all the "necessary libraries" but make sure you have added them to your class path.

enter image description here

grepit
  • 21,260
  • 6
  • 105
  • 81
  • the meta-inf file being replaced was merely a warning, not an actual error. It still gives me "JAR creation failed. See details for additional information. uk/co/eluinhost/UltraHardcore/features/core [in UHC] is not on its project's build path Unable to get package fragment root: UHC/uk/co/eluinhost/UltraHardcore/features/core/GoldenHeads.java uk/co/eluinhost/UltraHardcore/features/core [in UHC] is not on its project's build path" –  Sep 12 '13 at 01:20
  • @user2577576 I updated the answer for you. Hope it helps you. – grepit Sep 12 '13 at 02:16
  • please pardon the stupid question, but how can you go about adding something to the class path? –  Sep 12 '13 at 02:22
  • @user2577576 take a look here http://stackoverflow.com/questions/11463354/how-to-put-a-jar-in-classpath-in-eclipse – grepit Sep 12 '13 at 02:24
0

Import the project from the parent folder, that's what fixed it for me. In case you haven't noticed, they are not packages in your eclipse picture, that's one reason

Jonesy
  • 1