• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Java Program will only run on my PC?

 
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
 
Saloon Keeper
Posts: 6588
160
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • 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
 
Marshal
Posts: 15875
265
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • 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
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic