Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inconsistent Compiler Error

 
Dennis Putnam
Ranch Hand
Posts: 313
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 21123
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Dennis Putnam
Ranch Hand
Posts: 313
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply. I hadn't thought of that but yes, that is exactly what is happening.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic