Mailinglist Archive: opensuse-packaging (83 mails)

< Previous Next >
Re: [opensuse-packaging] How to set javac target ?
  • From: Stefan Dirsch <sndirsch@xxxxxxx>
  • Date: Mon, 27 Oct 2008 15:55:10 +0100
  • Message-id: <20081027145510.GA10126@xxxxxxx>
On Mon, Oct 27, 2008 at 03:05:58PM +0100, Thomas Schmidt wrote:
Stefan Dirsch wrote:
On Mon, Oct 27, 2008 at 01:12:35PM +0100, Thomas Schmidt wrote:
Stefan Dirsch wrote:

I'm wondering how to set the javac target in a specfile.

ERROR: the files above contain java bytecode for something later than
java 1.5,
ERROR: please set the javac target to 1.5 or lower.

BTW, the error message contradicts itself ("later" means "lower"
version number?).

--> /usr/lib/rpm/brp-check-bytecode-version

How to reproduce:

osc co home:sndirsch geotag
cd home:sndirsch/geotag
env -u BUILD_DIST osc build
Your package only contains already compiled java code in a .jar file,
so there is no way to set a java version target.

Ok. So this basically means that packaging .jar files is impossible
using our buildservice. :-( Still the error message is confusing.

It would work when the .jar would have been built for Java 1.5 or lower.
But anyway it would not be ok I think, because you are packaging
a binary only file.

During compilation the java target version can be set with: javac
-target 1.5 for example.

According to the Geotag website you need eclipse to build the sources.

Not sure how this is supposed to work in our buildservice. :-(

The advantage of using eclipse is, that it has the junit dependency built in,
can create the jar archive by mouseclick.

You can build it manually like this:
find . -name \*.java > files
sudo zypper in junit
mkdir build
javac -d build -target 1.5 -nowarn -cp /usr/share/java/junit.jar @files
jar -c build > output.jar

Thanks. Indeed build works fine (but only with SUN Java, which
apparently is not available in our buildservice), but trying to run it

Failed to load Main-Class manifest attribute from

Best regards,

P.S.: Is there a policy, which Java to use for building Java files?

Public Key available
Stefan Dirsch (Res. & Dev.) SUSE LINUX Products GmbH
Tel: 0911-740 53 0 Maxfeldstraße 5
FAX: 0911-740 53 479 D-90409 Nürnberg Germany
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups