• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Program will only run on my PC?  RSS feed

 
Vincent Hammond
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Guys,

I just finished a Java assignment and it runs perfect on my PC but when i try run it on my college PC I get many errors?

We use textPad.

My program is as below and runs fine but on my college pc i'm getting 34 errors saying "C:\Users\b00100070\Desktop\CreditUnion.java:162: error: ')' expected
        open.addActionListener((ActionEvent event) -> {
                                           ^
C:\Users\b00100070\Desktop\CreditUnion.java:162: error: illegal start of expression
        open.addActionListener((ActionEvent event) -> {
                                                    ^
C:\Users\b00100070\Desktop\CreditUnion.java:162: error: illegal start of expression
        open.addActionListener((ActionEvent event) -> {
                                                      ^
C:\Users\b00100070\Desktop\CreditUnion.java:214: error: ')' expected
            btn.addActionListener((ActionEvent event2) -> {
                                              ^
C:\Users\b00100070\Desktop\CreditUnion.java:214: error: illegal start of expression
            btn.addActionListener((ActionEvent event2) -> {
                                                        ^
C:\Users\b00100070\Desktop\CreditUnion.java:214: error: illegal start of expression
            btn.addActionListener((ActionEvent event2) -> {
                                                          ^
C:\Users\b00100070\Desktop\CreditUnion.java:222: error: illegal start of type
            });" etc.. etc....

[javadoc]
[/javadoc]

Any help would be really appreciated

Thanks
 
Tim Moores
Saloon Keeper
Posts: 4024
94
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're using Java 8 features, and it seems the compiler is complaining about those. Which Java version does the computer at your school have? Maybe it's only Java 7.
 
Vincent Hammond
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the reply and I think you must be correct. I do believe the computer I was on had an older version of Java that must be it . I'll check tomorrow -- thanks so much
 
Junilu Lacar
Sheriff
Posts: 11477
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can verify what Tim said.  Launch a command prompt window then type the following command:

C:\> javac -version

and verify that the version is at least 1.8.xxx -- if you're running a Java 7 version of the compiler, then you'll see 1.7.xxx or worse, 1.6.xxx.
 
Vincent Hammond
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Junilu Lacar wrote:You can verify what Tim said.  Launch a command prompt window then type the following command:

C:\> javac -version

and verify that the version is at least 1.8.xxx -- if you're running a Java 7 version of the compiler, then you'll see 1.7.xxx or worse, 1.6.xxx.


Thank you I'll try this tomorrow that's a good idea
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!