wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 210
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: 18545
    
  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: 210
Thanks for the reply. I hadn't thought of that but yes, that is exactly what is happening.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Inconsistent Compiler Error
 
Similar Threads
Give the easiest example which differentiate "interface" and "abstract class" in Java.
Table Viewer GUI from a Database
Chapter 3, Head First Servlets and JSP
Windows 8 fail
Illegal static declaration