Skip to content

Print warning if adding parent folder of library to the classpath #4797#4817

Open
fedejeanne wants to merge 1 commit intoeclipse-jdt:masterfrom
vi-eclipse:warn_about_parent_folder_in_classpath_of_jar_files
Open

Print warning if adding parent folder of library to the classpath #4797#4817
fedejeanne wants to merge 1 commit intoeclipse-jdt:masterfrom
vi-eclipse:warn_about_parent_folder_in_classpath_of_jar_files

Conversation

@fedejeanne
Copy link
Copy Markdown
Contributor

What it does

Print a warning in the trace log if the Class-Path entry in the manifest file of a third-party library includes a parent folder. This might not be forbidden but it's a dangerous practice.

Contributes to: #4797

How to test

  • Launch the Runtime Workspace, making sure that tracing is enabled like this:
image
  • Import the 2 projects in this ZIP: projects.zip
  • Restart the application

Expected

This should appear in the Console output:

| main | 2026-02-03 14:26:33.814 | org.eclipse.jdt.core | /debug | org.eclipse.jdt.internal.core.ClasspathEntry | resolvedChainedLibraries | 993 | WARN: Classpath entry ../ in manifest of jar file: \a\lib\badlib.jar references a parent folder. This may cause issues like: https://github.com/eclipse-jdt/eclipse.jdt.core/issues/4797 |

Author checklist

@fedejeanne
Copy link
Copy Markdown
Contributor Author

@iloveeclipse I know you said you are busy in the next few weeks but maybe you could still make some time to take a look at this PR? It is pretty small and it merely adds a warning when some 3rd-party library does something risky like adding a parent folder to the classpath (which, as you said yourself in #4797 (comment), is a PITA). That way we could at least identify such bad libraries and handle them better.

Thank you in advance!

Comment thread org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java Outdated
@fedejeanne fedejeanne force-pushed the warn_about_parent_folder_in_classpath_of_jar_files branch from 682f867 to 79e9d01 Compare April 7, 2026 11:02
…ipse-jdt#4797

Print a warning in the trace log if the Class-Path entry in the manifest
file of a third-party library includes a parent folder. This might not
be forbidden but it's a dangerous practice.

Contributes to:
eclipse-jdt#4797
@fedejeanne fedejeanne force-pushed the warn_about_parent_folder_in_classpath_of_jar_files branch from 79e9d01 to 5fc4534 Compare April 7, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants