sbegaudeau / AngularJS-Eclipse-Tools

AngularJS Eclipse Tools
14 stars 29 forks source link

Fixed getter for system line separator #6

Open m99coder opened 10 years ago

m99coder commented 10 years ago

Had to fix the line separator getters for Java 1.7

sbegaudeau commented 10 years ago

What was the issue with System.lineSeparator()?

m99coder commented 10 years ago

Got this error with „mvn clean verify“:

Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.17.0:compile (default-compile) on project org.obeonetwork.angularjs.eclipse.tools.ide.core: Compilation failure: Compilation failure:
[ERROR] /.../AngularJS-Eclipse-Tools-master/bundles/org.obeonetwork.angularjs.eclipse.tools.ide.core/src/main/java/org/obeonetwork/angularjs/eclipse/tools/ide/core/internal/project/AngularJSProject.java:[75,0]
[ERROR] String lineSeparator = System.lineSeparator();
[ERROR] ^^^^^^^^^^^^^
[ERROR] The method lineSeparator() is undefined for the type System
[ERROR] 1 problem (1 error)

I’m using Java(TM) SE Runtime Environment (build 1.7.0_10-b18) and Apache Maven 3.0.5 on Mac OS X 10.8.5 with Eclipse Kepler Service Release 1 (Build id: 20130919-0819).

sbegaudeau commented 10 years ago

In this project, I am planning to use Java 7 and System.lineSeparator() was introduced with Java 7. Can you try to build with any new feature of Java 7 (a switch on a string for example). I think you will found the same issue. I think you may be facing an issue similar to this one (http://stackoverflow.com/questions/14043042/compiling-java-7-code-via-maven).

Purely on a technical level, there are no difference at all or even no really valid reason to use System.lineSeparator() instead of System.getProperty("line.separator") but if I am right and if you can't compile any Java 7 source code, I think it's more interesting for you to fix this issue.

m99coder commented 10 years ago

You are right. This addition to ~/.profile did it:

export JAVA_HOME=`/usr/libexec/java_home -v 1.7`

Sorry for the inconvenience. Are you planning to support an outline view and code completion, which would be very useful in the scope of AngularJS application programming.