0

I'm using the PostToWeb library for Processing (http://libraries.seltar.org/postToWeb/), but when I try to run the sketch, I get an error telling me that the JAR for the class is compiled against Java 1.6, whereas the version of Processing that I'm using (1.5) uses Java 1.5

So, how would I go about recompiling the code src against Java 1.5?

Or, is there some other potential workaround?

Thanks.

4
  • 1
    how do you build your jar ? Feb 5, 2014 at 18:54
  • @JigarJoshi, I did not build the JAR, I downloaded it from this site: libraries.seltar.org/postToWeb
    – JackKalish
    Feb 6, 2014 at 2:27
  • download source and rebuild it to your required version Feb 6, 2014 at 3:54
  • I have the source, my question is how do I build? I tried using "javac -target 1.5" in my src folder but I get an error that says "javac: no source files"
    – JackKalish
    Feb 25, 2014 at 16:01

4 Answers 4

0

If you are using a dev tool, you should be able to mention the compile version in the project properties.

in Eclipse, Project Properties, Java Compiler, set compliance level to 1.5.

1
  • I am using the Processing IDE.
    – JackKalish
    Feb 6, 2014 at 2:25
0

It's as simple as:

javac -target 1.5

Otherwise you can specify it in maven with the compiler plugin

<compilerVersion>1.5</compilerVersion>
1
  • Hi thanks, I tried that but am getting a message that reads "No source files" even though I am calling it from within the src folder. What am I doing wrong?
    – JackKalish
    Feb 25, 2014 at 15:36
0

You could switch the version of Java you are running with to be version 6. Any jar compiled with version 5 will work with version 6. Just not vice versa. Then in the end you have a system running with an updated Java.

1
  • How do I change the Java version?
    – JackKalish
    Feb 6, 2014 at 2:25
0

There are command line parameters for the compiler that can control this. I have done this with Ant.

I googled for you and found http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javac.html which tells you to use -source 1.5 and -target 1.5 for these compiles.

2
  • I understand that, but I'm looking for specifics on how to do it. What are the command line parameters?
    – JackKalish
    Feb 25, 2014 at 15:33
  • @JackKalish updated my answer for you. Please accept.
    – Thom
    Feb 25, 2014 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.