Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #30992

catch unsupported class version error

From Philipp Kraus <philipp.kraus@flashpixx.de>
Newsgroups comp.lang.java.programmer
Subject catch unsupported class version error
Date 2015-02-01 23:49 +0100
Organization Clausthal University of Technology
Message-ID <mamaha$28kl$1@ariadne.rz.tu-clausthal.de> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hello,

I use a Maven build to create a Jar file from my program. I'm using the 
Maven options

<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>

because within the source I use some 1.8 features e.g. thread-stealing pool.
If I run the Jar on a version < 1.8 I get the error "unsupported 
major.minor version" with a stacktrace.
IMHO I cannot catch the error, because it is thrown by a native method 
of the VM, I have found a solution,
that I can compile a class with e.h. 1.7 option and check the running 
version of the VM and create an error
message on a wrong version. 

I would like to create error like "You are need Java 1.8" and the user, 
which run's the Jar does not see the stacktrace.
How can I do check the VM version and create a nice error message?

Thanks

phil

Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

catch unsupported class version error Philipp Kraus <philipp.kraus@flashpixx.de> - 2015-02-01 23:49 +0100
  Re: catch unsupported class version error Arne Vajhøj <arne@vajhoej.dk> - 2015-02-01 18:00 -0500
    Re: catch unsupported class version error v_borchert@despammed.com (Volker Borchert) - 2015-02-02 00:29 +0000
      Re: catch unsupported class version error Arne Vajhøj <arne@vajhoej.dk> - 2015-02-01 21:26 -0500
  Re: catch unsupported class version error Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2015-02-02 06:53 +0000

csiph-web