• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Compiling in Eclipse 3.6.0 but failing with Javac

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hiii,

After I completed my project with Eclipse 3.6 and everything is running ok on my machine (java version "1.6.0_22"). I moved my files to my school server using FileZilla. Then, I logged in to that server using Putty. After that, I tried to compile my files with javac and it failed to compile there!! (java version "1.4.2_13")

I would appreciate any help in resolving this issue!

Here is an example of compiling one of the files:

javac Prefix.java

Prefix.java:10: <identifier> expected
private ArrayList<String> words;
^
Prefix.java:16: <identifier> expected
public Prefix(ArrayList<String> words) {
^
Prefix.java:38: illegal character: \64
@Override
^
Prefix.java:54: illegal character: \64
@Override
^
Prefix.java:63: illegal character: \64
@Override
^
Prefix.java:72: ')' expected

^
6 errors

Thanks,

 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Generics and annotations were features that were added with Java 5. It isn't available with Java 1.4.

Henry
 
Amad Sin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Henry, thanks for your reply!

but this is the first time i got such errors. I previously compiled many files which includes generics on the same server with javac! including ArrayList<Type> and LinkedList<Type>!!

Now, I cannot even compile my previous files which i did not have issues with!

do you think i have a problem with my java version on my account on the linux server?! I recently installed tomcat server on my account there!

What do you propose at a soultion to this?

Thanks,
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would double check the java version. At least you need Java 5 maybe Java 6.
 
Henry Wong
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Amad Sin wrote:but this is the first time i got such errors. I previously compiled many files which includes generics on the same server with javac! including ArrayList<Type> and LinkedList<Type>!!

Now, I cannot even compile my previous files which i did not have issues with!



We don't have any information about why it used to compile on the system and doesn't do so now -- all we can tell you is that the version of Java currently installed on that system doesn't support the features that you want.

Henry
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you all for the kind questions ans answers. I joined the forum to inform my fix.

[1] Go to Project->properties->Java Compiler
Select 1.6 but this is not enough. Momentrarily when I saw to the link to installed JREs, I changed to jrockit_160_17_R28.0.0-679 as below.
When you can't see the link to JREs change. Simply do the following.

[2] Go to windows->preferences->java->installed JREs
Selected C:\Oracle\Middleware\jrockit_160_17_R28.0.0-679 (instead of C:\Program Files\Java\jre1.6.0_07, though not sure)

[3] Go to Project->properties->resource
UTF-8 for Text file encoding (maybe not critical)
Windows for New text file inline delimiter (maybe not critical)

Good day every day.
William
 
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch William Kim
reply
    Bookmark Topic Watch Topic
  • New Topic