Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

How to pass command line parameters to the java compiler #2304

Copy link
Copy link
@slPerryRhodan

Description

@slPerryRhodan
Issue body actions

In my project we use spring data with named parameter, which is running fine with IntelliJ, but in VSCode I get the following exception:

2022-01-28 11:01:15,170 |-ERROR in at.***.commons.exception.RestExceptionHandler - For queries with named parameters you need to use provide names for method parameters. Use @Param for query method parameters, or when on Java 8+ use the javac flag -parameters.; nested exception is java.lang.IllegalStateException: For queries with named parameters you need to use provide names for method parameters. Use @Param for query method parameters, or when on Java 8+ use the javac flag -parameters.
org.springframework.dao.InvalidDataAccessApiUsageException: For queries with named parameters you need to use provide names for method parameters. Use @Param for query method parameters, or when on Java 8+ use the javac flag -parameters.; nested exception is java.lang.IllegalStateException: For queries with named parameters you need to use provide names for method parameters. Use @Param for query method parameters, or when on Java 8+ use the javac flag -parameters.
	at org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:371)
EntityManagerFactoryUtils.java:371
	...

In IntelliJ I can set "Additional command line parameters" under Settings -> Build, Execution, Deployment -> Compiler -> Java Compiler. And this issue is solved, if I add "-parameters" as command line parameter in IntelliJ, but I have no clue how to do this in VSCode. I can only find information about passing vmarg parameters in VSCode.

Environment
  • Operating System: Win 10
  • JDK version: 11
  • Visual Studio Code version: 1.63.2
  • Java extension version: Language Support for Java(TM) by Red Hat v1.3.0
Steps To Reproduce

Use Spring Data with named parameters (Spring Docu Named Parameters) without the annotation @param and the compiler flag
"-parameters" is not #set.

Current Result
  • Can run the applications until the the application tries to access via spring data the database and then it throws the mentioned exception
  • Run & Debug Tests (e.g. Integration / Karate tests) not possible because of the mentioned excetpion
Expected Result
  • pass java compiler flags like "-parameters" should be possible
Additional Informations

#2269

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.