29 Jan 2012, 14:27
Generic-user-small

Daniel Sheffner (2 posts)

I’m very new to java and I’m not sure why I’m getting this error when trying to use ant in the code example. This is on page 47. I believe I have everything setup correctly but it is throwing this stack trace. I’m using jruby 1.6.5.1, Sun java version 1.6.0_26, ant 1.8.1, and ubuntu 11.04 64 bit. Any help would be greatly appreciated.

Thanks,

Dan

ant Buildfile: ~/software/code/ruby_from_java/historian/build.xml

-pre-init:

-init-private:

-init-user:

-init-project:

-init-macrodef-property:

-do-init:

-post-init:

-init-check:

-init-macrodef-javac:

-init-macrodef-junit:

-init-debug-args:

-init-macrodef-nbjpda:

-init-macrodef-debug:

-init-macrodef-java:

-init-presetdef-jar:

init:

deps-jar:

-check-automatic-build:

-clean-after-automatic-build:

-verify-automatic-build:

-pre-pre-compile:

-pre-compile:

-compile-depend:

-do-compile: [javac] Compiling 11 source files to ~/software/code/ruby_from_java/historian/build/classes [javac] An exception has occurred in the compiler (1.6.0_26). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you. [javac] java.lang.ClassFormatError: Truncated class file [javac] at java.lang.ClassLoader.defineClass1(Native Method) [javac] at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) [javac] at java.lang.ClassLoader.defineClass(ClassLoader.java:615) [javac] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [javac] at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) [javac] at java.net.URLClassLoader.access$000(URLClassLoader.java:58) [javac] at java.net.URLClassLoader$1.run(URLClassLoader.java:197) [javac] at java.security.AccessController.doPrivileged(Native Method) [javac] at java.net.URLClassLoader.findClass(URLClassLoader.java:190) [javac] at java.lang.ClassLoader.loadClass(ClassLoader.java:306) [javac] at java.lang.ClassLoader.loadClass(ClassLoader.java:247) [javac] at com.sun.tools.javac.comp.Attr.(Attr.java:84) [javac] at com.sun.tools.javac.comp.Attr.instance(Attr.java:74) [javac] at com.sun.tools.javac.comp.Annotate.(Annotate.java:52) [javac] at com.sun.tools.javac.comp.Annotate.instance(Annotate.java:36) [javac] at com.sun.tools.javac.jvm.ClassReader.(ClassReader.java:215) [javac] at com.sun.tools.javac.jvm.ClassReader.instance(ClassReader.java:168) [javac] at com.sun.tools.javac.main.JavaCompiler.(JavaCompiler.java:293) [javac] at com.sun.tools.javac.main.JavaCompiler.instance(JavaCompiler.java:72) [javac] at com.sun.tools.javac.main.Main.compile(Main.java:340) [javac] at com.sun.tools.javac.main.Main.compile(Main.java:279) [javac] at com.sun.tools.javac.main.Main.compile(Main.java:270) [javac] at com.sun.tools.javac.Main.compile(Main.java:69) [javac] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [javac] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [javac] at java.lang.reflect.Method.invoke(Method.java:597) [javac] at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56) [javac] at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1097) [javac] at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:906) [javac] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) [javac] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) [javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [javac] at java.lang.reflect.Method.invoke(Method.java:597) [javac] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [javac] at org.apache.tools.ant.Task.perform(Task.java:348) [javac] at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68) [javac] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) [javac] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) [javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [javac] at java.lang.reflect.Method.invoke(Method.java:597) [javac] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [javac] at org.apache.tools.ant.Task.perform(Task.java:348) [javac] at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398) [javac] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) [javac] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) [javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [javac] at java.lang.reflect.Method.invoke(Method.java:597) [javac] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [javac] at org.apache.tools.ant.Task.perform(Task.java:348) [javac] at org.apache.tools.ant.Target.execute(Target.java:390) [javac] at org.apache.tools.ant.Target.performTasks(Target.java:411) [javac] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397) [javac] at org.apache.tools.ant.Project.executeTarget(Project.java:1366) [javac] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) [javac] at org.apache.tools.ant.Project.executeTargets(Project.java:1249) [javac] at org.apache.tools.ant.Main.runBuild(Main.java:801) [javac] at org.apache.tools.ant.Main.startAnt(Main.java:218) [javac] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) [javac] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

BUILD FAILED /home/thesheff17/software/code/ruby_from_java/historian/nbproject/build-impl.xml:364: The following error occurred while executing this line: /home/thesheff17/software/code/ruby_from_java/historian/nbproject/build-impl.xml:173: Compile failed; see the compiler error output for details.

Total time: 0 seconds

30 Jan 2012, 22:02
Mr_sketchy_pragsmall

Ian Dees (195 posts)

Hi, Daniel.

Sorry about this. I’m not sure why @javac@ is crashing; I’ve written to Nick and Tom to see if they’ve seen this error before.

–Ian

30 Jan 2012, 22:50
Generic-user-small

Nicholas Sieger (5 posts)

Daniel,

Right after you see this error, what do you get for the output of the following commands:

  • @ant -version@
  • @java -version@
  • @jruby -version@

I know you said you have all the versions installed and those seem to be correct, I just want to verify that those are the versions that are being used when you go to build and run the code.

/Nick

02 Feb 2012, 16:34
Generic-user-small

Daniel Sheffner (2 posts)

Here my output. I upgraded my development machine the latest release of ubuntu, rvm, & jruby. ant and java where installed through apt-get.

∴ ant -version Apache Ant(TM) version 1.8.2 compiled on August 19 2011

∴ java -version java version “1.6.0_26” Java(TM) SE Runtime Environment (build 1.6.0_26-b03) Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

∴ jruby –version jruby 1.6.6 (ruby-1.8.7-p357) (2012-01-30 5673572) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_26) [linux-amd64-java]

  You must be logged in to comment