Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set java version to 1.7 #74

Closed
enchev opened this issue May 26, 2015 · 5 comments
Closed

How to set java version to 1.7 #74

enchev opened this issue May 26, 2015 · 5 comments
Labels

Comments

@enchev
Copy link

enchev commented May 26, 2015

From @duongnhatduy on May 25, 2015 11:40

I run to this error when trying to import FacebookSDK to android platform.

-compile:
[javac] Compiling 151 source files to /Users/duyduong/Dev/tns/lib/Android/FacebookAndroidSDK/bin/classes
[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] /Users/duyduong/Dev/tns/lib/Android/FacebookAndroidSDK/src/com/facebook/AccessToken.java:559: error: diamond operator is not supported in -source 1.5
[javac] ArrayList permissionsList = new ArrayList<>();
[javac] ^
[javac](use -source 7 or higher to enable diamond operator)
[javac] /Users/duyduong/Dev/tns/lib/Android/FacebookAndroidSDK/src/com/facebook/AccessTokenManager.java:224: error: diamond operator is not supported in -source 1.5
[javac] final Set permissions = new HashSet<>();
[javac] ^

The FacebookSDK version is 4.1.2.

Copied from original issue: NativeScript/NativeScript#213

@rosen-vladimirov
Copy link
Contributor

Hi @duongnhatduy
In order to set your version of JAVA to 1.7, you have to set your JAVA_HOME environment variable to point to you jdk 1.7:
Can you try this:

export JAVA_HOME=jdk-install-dir
export PATH=$JAVA_HOME/bin:$PATH

@duongnhatduy
Copy link

Hi @rosen-vladimirov ,
I have 1.8 on my mac os.
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java -version
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b27)

Does this problem relates to the compiler?

@rosen-vladimirov
Copy link
Contributor

Hi @duongnhatduy ,
Can you send us the output of

echo $JAVA_HOME

@duongnhatduy
Copy link

@rosen-vladimirov
It is /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home

@Plamen5kov
Copy link
Contributor

as @rosen-vladimirov said the JAVA_HOME should point to jdk folder:
JAVA_HOME=/user/folder/jdk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants