question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Include only tools.jar as "system jar", not the entire jre/../lib folder

See original GitHub issue

Hello,

I have a folder structure as below:

  • root
    • jre
      • JRE files (“java.home” points to this)
    • lib
      • my jars

The current logic within JREUtils is seeing all my jars within this “lib” folder as “system jars”:

            if (javaHomeFile.getName().equals("jre")) {
                // Handle jre/../lib/tools.jar
                final File parent = javaHomeFile.getParentFile();
                if (parent != null) {
                    final File parentLibFile = new File(parent, "lib");
                    addJREPath(parentLibFile, jrePathsSet);
                }
            }

Would it be possible - and sensible - to only regard “tools.jar” as a system jar, instead of the entire “lib” folder?

This was tested with version 3.1.0.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
gcristescucommented, Jun 26, 2018

@lukehutch looks good. I tested "lib:", "lib:my.jar", "lib:prefix*"; it took me longer, because I had a problem with the log (with .verbose()) not being generated at all. Turned to be an out-of-memory issue on my part; obviously all this lib scanning needs to be done carefully.

Thank you for your support, and I’ll just take advantage of the opportunity to tell you that this is an awesome little project - good luck with all!

0reactions
lukehutchcommented, Jun 27, 2018

Oops, ignore the last commit message, I referenced the wrong bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to locate tools.jar - java - Stack Overflow
I am building a project in Java. I have installed a JDK and the folder: C:\Program Files\Java\jre6\lib is in my system but the...
Read more >
Where to put tools.jar in JRE 7? - Ideas Not For Sale
So I guess it means that the only true place for tools.jar is the jre/lib folder! Share this: Twitter · Facebook ...
Read more >
Tools.jar not found !
Hi Pratha,. This issue is caused when the ​tools.jar file is not present in the $JAVA_HOME/lib directory (in the application server machine).
Read more >
jdeps - Oracle Help Center
The input class can be a path name to a .class file, a directory, a JAR file, or it can be a fully...
Read more >
How Classes are Found
The tools classes are now in a separate archive (tools.jar) and can only be used if included in the user class path (to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found