Error 206 when testing JUnit in Eclipse

I have a problem when I try to run a JUnit test class in Eclipse.

An error occurred while executing the command line. Cannot start the program "C: \ Program Files \ Java \ jre7 \ bin \ javaw.exe" (in the directory "C: \ Users \ User \ Documents \ Projects \ MyProject"): Error CreateProcess = 206, file name or extension too long

After I got this error, I started looking for how to fix this problem ... However, now I have created a MANIFEST file containing all the banks I need, but I do not know how to transfer the new manifest file to the project, and also what to do with banks in my catalog?

Thanks in advance!

EDIT:

I have a SimpleTest class and a TestRunner class

public class SimpleTest { @Test public void testAssertions() { String str1 = new String ("abc"); String str2 = new String ("abc"); assertEquals(str1, str2); } } package com.epb.junit; import org.junit.runner.JUnitCore; import org.junit.runner.Result; import org.junit.runner.notification.Failure; public class TestRunner { public static void main(String[] args) { Result result = JUnitCore.runClasses(SimpleTest.class); for (Failure failure : result.getFailures()) { System.out.println(failure.toString()); } System.out.println(result.wasSuccessful()); } } 

Nothing interesting here, I just need to know how to pack all my JAR files that I use because there are too many of them ... I made a manifest file with all of them, but I don’t know how to transfer it instead of JAR files.

PS I am running a test class with the parameter Eclipse -> Run As -> JUnit Test. After an error occurred, I made this TestRunner class, and I run it as a Java application, but still error 206. From what I read, I realized that my build path is too long because there are a lot of JARS, so now I'm looking to find a way to shorten this Path and pack banks in one. I tried to export the lib folder to a Jar file, but that didn't work.

EDIT 2

The last thing I tried for almost a moment was to create an "empty jar" containing only the Manifest.mf file in it. I put this jar in my Build Path project instead of all the other Jars, but still no result ... now the project has errors for the path built ...

+5
source share
2 answers

All you have to do is follow these steps:

  • copy eclipse / plugins / org.eclipse.jdt.launching_3.4. *. jar to a safe place outside the plugins folder, so you always have a way to return
  • close eclipse
  • rename * .jar to * .zip
  • open the zip file and copy 4 class files from the attachment to org \ eclipse \ jdt \ internal \ launch (replace existing files)
  • go to META-INF in the zip file and delete all files except MANIFEST.MF
  • extract MANIFEST.MF to your disk and edit it using a text editor.
  • delete everything from the first record "NAME:"
  • make sure you leave two (2) line breaks at the end of the file!
  • save MANIFEST.MF and copy it back to the zip file
  • rename * .zip back to * .jar
  • Replace the modified can with the can in the Eclipse / plugin catalog!
  • Enjoy it!

PS. The CONFIRMATION from step 4 can be downloaded here:

https://bugs.eclipse.org/bugs/attachment.cgi?id=216637

Thanks to Mr. Marcus Keller, who created these steps!

+4
source

I solved this by following the steps below. Please do the following

Choose Project-> Properties-> select Google App Engine β†’ ORM and include only directories containing the classes you want to improve.

-1
source

All Articles