• 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Java Program will only run on my PC?  RSS feed

 
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: 5480
143
Android Firefox Browser Mac OS X Safari Tomcat Server VI Editor
  • 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
 
Sheriff
Posts: 13456
222
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
 
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!