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

Provide preference mapping for Java Execution Environments -> Runtimes #1307

Closed
fbricon opened this issue Dec 17, 2019 · 3 comments · Fixed by #1309
Closed

Provide preference mapping for Java Execution Environments -> Runtimes #1307

fbricon opened this issue Dec 17, 2019 · 3 comments · Fixed by #1309
Assignees

Comments

@fbricon
Copy link
Contributor

fbricon commented Dec 17, 2019

We need a set of preferences so that you can define multiple Java runtimes, that can be different from the runtime used to launch jdt.ls.

eg.

"java.configuration.runtimes": {
"JavaSE-1.8": {
     path:"/path/to/jdk/1.8.301",
     sources:"/path/to/jdk/1.8.301/sources.jar",  //optional
     javadoc:"/path/to/jdk/1.8.301/javadoc.jar",  //optional
  },
"JavaSE-11": {
     path:"/path/to/jdk/11.0.301",
  }
}  

The keys would map 1:1 to the JDT Execution Environments.

@snjeza
Copy link
Contributor

snjeza commented Dec 17, 2019

@fbricon Could we define the java.configuration.runtime property as

"java.configuration.runtimes": [
        {
            "name": "JavaSE-1.8",
            "path": "/path/to/jdk/1.8.301",
            "sources": "/path/to/jdk/1.8.301/sources.jar",
            "javadoc": "/path/to/jdk/1.8.301/javadoc.jar"
        },
        {
            "name": "JavaSE-11",
            "path": "/path/to/jdk/11.0.301",
        }
    ]

@fbricon
Copy link
Contributor Author

fbricon commented Dec 17, 2019

ok, if it makes things easier

@fbricon
Copy link
Contributor Author

fbricon commented Jan 10, 2020

Final syntax looks like :

"java.configuration.runtimes": [
        {
            "name": "JavaSE-1.8",
            "path": "/usr/local/jdk1.8.0_201"
        },
        {
            "name": "JavaSE-11",
            "path": "/usr/local/jdk-11.0.3",
            "sources" : "/usr/local/jdk-11.0.3/lib/src.zip",
            "javadoc" : "https://docs.oracle.com/en/java/javase/11/docs/api",
            "default":  true
        },
        {
            "name": "JavaSE-12",
            "path": "/usr/local/jdk-12.0.2"
        },
        {
            "name": "JavaSE-13",
            "path": "/usr/local/jdk-13"
        }
    ]

Runtime name must be one of:
"J2SE-1.5",
"JavaSE-1.6",
"JavaSE-1.7",
"JavaSE-1.8",
"JavaSE-9",
"JavaSE-10",
"JavaSE-11",
"JavaSE-12",
"JavaSE-13"

List will be updated with each supported release of the JDK

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

Successfully merging a pull request may close this issue.

2 participants