-
Notifications
You must be signed in to change notification settings - Fork 453
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
JAR files are not refreshed after they are updated. #775
Comments
I don't think this extension provide a command call "Java: Refresh". Also, how do you copy the JAR files to the projects? Change the .classpath file or other way? |
The ".classpath" file does not change. The JAR files do not have a version in their name (I know bad practice :)). So the only thing that changes is the JAR file itself. |
The comment by "yaohaizh" tipped me off to a possible workaround. I "touched" the ".classpath" file in the project that was taking in the changed JAR and then the "linting" picked up a change without a restart of vscode. I am still interested in a command to manually force this refresh (or something equivalent) but this workaround definitely helps. |
The workaround of touching the ".classpath" file is not really working. When I save the source program referencing the new code (for example a new method in the updated JAR), the compile errors go away, but as soon as I make a single change to the file they come back which is odd. |
@wtbcode "Java: Force Java Compilation" works for you? |
I went to test that just now by adding a new method, creating the JAR, and copying it over into the "dependent" project and it just worked immediately. Fearing for my sanity, I added another method into the same class and repeated the steps, and reproduced the usual behavior that the change was not picked up. I then started with the "incremental" forced compile and that did not work and moved to the "full" compile which cleared all of the compiler errors and worked away. I waited until the status bar indicated the compile was no longer occurring and my CPU had settled down. At that point, I did not have any compile errors. As soon as I edited the file, the compile error came back on the second method, which is a little disturbing. The "intellisense" is in line with the compiler view of the classes. I get suggestions for the first method but not the second. |
where are the jars living? in the workspace or outside? If it's the former, we may be able to "refresh" the jar server-side, if vscode "watches" it, that "might" fix the issue. |
All of our projects have a ".classpath" file with reference to JAR files in a "lib" directory within the project. In the ".classpath" file the entries look like this:
Basically the relationship between projects is pretty "old school". I build one project and then copy the JAR into another (through the OS) to satisfy compile dependencies. All of the projects are first level entries in a "c:\projects" directory (e.g. "c:\projects\foo") and the workspace file (*.code-workspace) is in the "c:\projects" directory. |
[provide a description of the issue]
Environment
Steps To Reproduce
I am working with Eclipse projects that do not use Maven or Gradle. We use ANT to build our JAR files and manually copy the JAR files to projects that depend on them as needed. What I am finding is that vscode will not pick up the changes in an updated JAR file unless I restart the editor. I have tried the "Java: Refresh" command in hopes that it would trigger whatever is happening on startup to recognize the JAR file update. I am hoping that there is a way to manually trigger a "project" reevaluation after these updates.
Current Result
I have to restart vscode to see JAR file changes.
Expected Result
vscode watches the file and automatically does the update or provides a command I can use to trigger the update.
Additional Informations
The text was updated successfully, but these errors were encountered: