aspose file tools*
The moose likes Java in General and the fly likes Inconsistent Compiler Error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Inconsistent Compiler Error" Watch "Inconsistent Compiler Error" New topic
Author

Inconsistent Compiler Error

Dennis Putnam
Ranch Hand

Joined: Feb 03, 2012
Posts: 217
I am developing my Java app using Eclipse on Windows and am getting error free compiles on this method:

However, when I compile on Linux, I get these compiler errors:

[javac] /var/www/html/Applets/KCBSEvents/src/KCBSEvents/Helpers.java:228: <identifier> expected
[javac] } catch (NoSuchAlgorithmException | NoSuchPaddingException |InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
[javac] ^
[javac] /var/www/html/Applets/KCBSEvents/src/KCBSEvents/Helpers.java:228: '{' expected
[javac] } catch (NoSuchAlgorithmException | NoSuchPaddingException |InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
[javac] ^
[javac] /var/www/html/Applets/KCBSEvents/src/KCBSEvents/Helpers.java:228: illegal start of expression
[javac] } catch (NoSuchAlgorithmException | NoSuchPaddingException |InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
[javac] ^
[javac] /var/www/html/Applets/KCBSEvents/src/KCBSEvents/Helpers.java:228: ';' expected
[javac] } catch (NoSuchAlgorithmException | NoSuchPaddingException |InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
[javac] ^
[javac] /var/www/html/Applets/KCBSEvents/src/KCBSEvents/Helpers.java:228: not a statement
[javac] } catch (NoSuchAlgorithmException | NoSuchPaddingException |InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
[javac] ^
[javac] /var/www/html/Applets/KCBSEvents/src/KCBSEvents/Helpers.java:228: ';' expected
[javac] } catch (NoSuchAlgorithmException | NoSuchPaddingException |InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
[javac] ^
[javac] /var/www/html/Applets/KCBSEvents/src/KCBSEvents/Helpers.java:228: not a statement
[javac] } catch (NoSuchAlgorithmException | NoSuchPaddingException |InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
[javac] ^
[javac] /var/www/html/Applets/KCBSEvents/src/KCBSEvents/Helpers.java:228: ';' expected
[javac] } catch (NoSuchAlgorithmException | NoSuchPaddingException |InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
[javac] ^

It is possible I am missing a library on the Linux side but the errors seem to indicate something else is wrong. Can someone clarify if this can be caused by simply a missing library or is there really something wrong with the syntax that Windows doesn't seem to mind? TIA.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 19073
    
  40

Dennis Putnam wrote:I am developing my Java app using Eclipse on Windows and am getting error free compiles on this method:

However, when I compile on Linux, I get these compiler errors:

[javac] /var/www/html/Applets/KCBSEvents/src/KCBSEvents/Helpers.java:228: <identifier> expected
[javac] } catch (NoSuchAlgorithmException | NoSuchPaddingException |InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
[javac] ^
[javac] /var/www/html/Applets/KCBSEvents/src/KCBSEvents/Helpers.java:228: '{' expected
[javac] } catch (NoSuchAlgorithmException | NoSuchPaddingException |InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
[javac] ^
[javac] /var/www/html/Applets/KCBSEvents/src/KCBSEvents/Helpers.java:228: illegal start of expression
[javac] } catch (NoSuchAlgorithmException | NoSuchPaddingException |InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
[javac] ^
[javac] /var/www/html/Applets/KCBSEvents/src/KCBSEvents/Helpers.java:228: ';' expected
[javac] } catch (NoSuchAlgorithmException | NoSuchPaddingException |InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
[javac] ^
[javac] /var/www/html/Applets/KCBSEvents/src/KCBSEvents/Helpers.java:228: not a statement
[javac] } catch (NoSuchAlgorithmException | NoSuchPaddingException |InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
[javac] ^
[javac] /var/www/html/Applets/KCBSEvents/src/KCBSEvents/Helpers.java:228: ';' expected
[javac] } catch (NoSuchAlgorithmException | NoSuchPaddingException |InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
[javac] ^
[javac] /var/www/html/Applets/KCBSEvents/src/KCBSEvents/Helpers.java:228: not a statement
[javac] } catch (NoSuchAlgorithmException | NoSuchPaddingException |InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
[javac] ^
[javac] /var/www/html/Applets/KCBSEvents/src/KCBSEvents/Helpers.java:228: ';' expected
[javac] } catch (NoSuchAlgorithmException | NoSuchPaddingException |InvalidKeyException | InvalidAlgorithmParameterException | IllegalBlockSizeException | BadPaddingException e) {
[javac] ^

It is possible I am missing a library on the Linux side but the errors seem to indicate something else is wrong. Can someone clarify if this can be caused by simply a missing library or is there really something wrong with the syntax that Windows doesn't seem to mind? TIA.



Looks like it is complaining about the multi-catch exception feature that was added with Java 7. Any chance that the Linux system is compiling with a version of Java prior to Java 7?

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Dennis Putnam
Ranch Hand

Joined: Feb 03, 2012
Posts: 217
Thanks for the reply. I hadn't thought of that but yes, that is exactly what is happening.
 
 
subject: Inconsistent Compiler Error