Monday, 15 March 2010

java ee - Error 206 occures on JUnit test in Eclipse -



java ee - Error 206 occures on JUnit test in Eclipse -

i have problem when seek run junit test class in eclipse.

exception occurred executing command line. cannot run programme "c:\program files\java\jre7\bin\javaw.exe" (in directory "c:\users\user\documents\projects\myproject"): createprocess error=206, filename or extension long

after received error started search how prepare problem... generated manifest file contains of jars need, don't know how pass new manifest file project , jars in lib dir?

thanks in advance!

edit:

i have simpletest class , testrunner class

public class simpletest { @test public void testassertions() { string str1 = new string ("abc"); string str2 = new string ("abc"); assertequals(str1, str2); } } bundle 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); (failure failure : result.getfailures()) { system.out.println(failure.tostring()); } system.out.println(result.wassuccessful()); } }

nothing interesting here, need know how pack of jar files using, because many... made manifest file of them don't know how pass instead of jar files.

p.s running test class eclipse -> run -> junit test option. after error occured i've made testrunner class , running java application still error 206. things read realized build path long, because there lot of jars i'm looking find way shorten path , pack jars one. i've tried export lib folder jar file doesn't worked.

edit 2

the lastly thing tried before moment create "pathing jar" contains manifest.mf file within it. set jar in project build path instead of other jars still no result... project has errors built path...

all need follow steps:

copy eclipse/plugins/org.eclipse.jdt.launching_3.4.*.jar safe place outside of plugins folder, have way revert close eclipse rename *.jar *.zip open zip file , re-create 4 class files attachment org\eclipse\jdt\internal\launching (replace existing files) go meta-inf in zip file , delete files except manifest.mf extract manifest.mf disk , edit text editor remove starting first "name:" entry make sure leave two (2) line break characters @ end of file! save manifest.mf , re-create zip file rename *.zip *.jar replace modified jar jar in eclipse/plugin directory! enjoy!

ps. attachment step 4 can downloaded here:

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

thanks mr.markus keller created steps!

java-ee junit

No comments:

Post a Comment