8000 codeanalyzer-java/README.md at v2.2.1 · codellm-devkit/codeanalyzer-java · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"allShortcutsEnabled":false,"fileTree":{"":{"items":[{"name":".devcontainer","path":".devcontainer","contentType":"directory"},{"name":".github","path":".github","contentType":"directory"},{"name":".settings","path":".settings","contentType":"directory"},{"name":"docs","path":"docs","contentType":"directory"},{"name":"gradle","path":"gradle","contentType":"directory"},{"name":"src","path":"src","contentType":"directory"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"build.gradle","path":"build.gradle","contentType":"file"},{"name":"gradle.properties","path":"gradle.properties","contentType":"file"},{"name":"gradlew","path":"gradlew","contentType":"file"},{"name":"gradlew.bat","path":"gradlew.bat","contentType":"file"},{"name":"settings.gradle","path":"settings.gradle","contentType":"file"}],"totalCount":14}},"fileTreeProcessingTime":10.940570000000001,"foldersToFetch":[],"incompleteFileTree":false,"repo":{"id":731300153,"defaultBranch":"main","name":"codeanalyzer-java","ownerLogin":"codellm-devkit","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2023-12-13T19:16:41.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/197800760?v=4","public":true,"private":false,"isOrgOwned":true},"codeLineWrapEnabled":false,"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"v2.2.1","listCacheKey":"v0:1750000172.0","canEdit":false,"refType":"tag","currentOid":"91b1d9db01b86091b98d947e714c661581f794bd"},"path":"README.md","currentUser":null,"blob":{"rawLines":null,"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/codellm-devkit/codeanalyzer-java/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"README.md","displayUrl":"https://github.com/codellm-devkit/codeanalyzer-java/blob/v2.2.1/README.md?raw=true","headerInfo":{"blobSize":"6.43 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":null,"isGitLfs":false,"onBranch":false,"shortPath":"bf70d63","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fcodellm-devkit%2Fcodeanalyzer-java%2Fblob%2Fv2.2.1%2FREADME.md","isCSV":false,"isRichtext":true,"toc":[{"level":2,"text":"1. Prerequisites","anchor":"1-prerequisites","htmlText":"1. Prerequisites"},{"level":3,"text":"1.1. Install SDKMan!","anchor":"11-install-sdkman","htmlText":"1.1. Install SDKMan!"},{"level":2,"text":"2. Building codeanalyzer","anchor":"2-building-codeanalyzer","htmlText":"2. Building codeanalyzer"},{"level":3,"text":"2.1. Install Java 11 or above","anchor":"21-install-java-11-or-above","htmlText":"2.1. Install Java 11 or above"},{"level":3,"text":"2.2. Build codeanalyzer","anchor":"22-build-codeanalyzer","htmlText":"2.2. Build codeanalyzer"},{"level":3,"text":"2.3. Using codeanalyzer","anchor":"23-using-codeanalyzer","htmlText":"2.3. Using codeanalyzer"},{"level":2,"text":"3. Installing codeanalyzer as a native binary (once built, no JVM will be required for running codeanalyzer)","anchor":"3-installing-codeanalyzer-as-a-native-binary-once-built-no-jvm-will-be-required-for-running-codeanalyzer","htmlText":"3. Installing codeanalyzer as a native binary (once built, no JVM will be required for running codeanalyzer)"},{"level":3,"text":"3.1. Install GraalVM using SDKMan","anchor":"31-install-graalvm-using-sdkman","htmlText":"3.1. Install GraalVM using SDKMan"},{"level":3,"text":"3.2. Build the Project","anchor":"32-build-the-project","htmlText":"3.2. Build the Project"},{"level":3,"text":"3.3. Using codeanalyzer","anchor":"33-using-codeanalyzer","htmlText":"3.3. Using codeanalyzer"},{"level":2,"text":"FAQ","anchor":"faq","htmlText":"FAQ"},{"level":2,"text":"LICENSE","anchor":"license","htmlText":"LICENSE"}],"lineInfo":{"truncatedLoc":"191","truncatedSloc":"133"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"Markdown","languageID":222,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/codellm-devkit/codeanalyzer-java/blob/v2.2.1/README.md","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/codellm-devkit/codeanalyzer-java/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/codellm-devkit/codeanalyzer-java/raw/refs/tags/v2.2.1/README.md","renderImageOrRaw":false,"richText":"\u003carticle class=\"markdown-body entry-content container-lg\" itemprop=\"text\"\u003e\u003cp dir=\"auto\"\u003e\u003ca target=\"_blank\" rel=\"noopener noreferrer\" href=\"/codellm-devkit/codeanalyzer-java/blob/v2.2.1/docs/assets/logo.png\"\u003e\u003cimg src=\"/codellm-devkit/codeanalyzer-java/raw/v2.2.1/docs/assets/logo.png\" alt=\"logo\" style=\"max-width: 100%; height: auto;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eNative WALA implementation of source code analysis tool for Enterprise Java Applications.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e1. Prerequisites\u003c/h2\u003e\u003ca id=\"user-content-1-prerequisites\" class=\"anchor\" aria-label=\"Permalink: 1. Prerequisites\" href=\"#1-prerequisites\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eBefore you begin, ensure you have met the following requirements:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eYou have a Linux/MacOS/WSL machine.\u003c/li\u003e\n\u003cli\u003eYou have installed the latest version of \u003ca href=\"/codellm-devkit/codeanalyzer-java/blob/v2.2.1/sdkman.io\"\u003eSDKMan!\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e1.1. Install SDKMan!\u003c/h3\u003e\u003ca id=\"user-content-11-install-sdkman\" class=\"anchor\" aria-label=\"Permalink: 1.1. Install SDKMan!\" href=\"#11-install-sdkman\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003col dir=\"auto\"\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eInstall SDKMan!\nOpen your terminal and enter the following command:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"curl -s \u0026quot;https://get.sdkman.io\u0026quot; | bash\"\u003e\u003cpre\u003ecurl -s \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003ehttps://get.sdkman.io\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e \u003cspan class=\"pl-k\"\u003e|\u003c/span\u003e bash\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eFollow the on-screen instructions to complete the installation.\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eOpen a new terminal or source the SDKMan! scripts:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"source \u0026quot;$HOME/.sdkman/bin/sdkman-init.sh\u0026quot;\"\u003e\u003cpre\u003e\u003cspan class=\"pl-c1\"\u003esource\u003c/span\u003e \u003cspan class=\"pl-s\"\u003e\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003cspan class=\"pl-smi\"\u003e$HOME\u003c/span\u003e/.sdkman/bin/sdkman-init.sh\u003cspan class=\"pl-pds\"\u003e\"\u003c/span\u003e\u003c/span\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e2. Building \u003ccode\u003ecodeanalyzer\u003c/code\u003e\u003c/h2\u003e\u003ca id=\"user-content-2-building-codeanalyzer\" class=\"anchor\" aria-label=\"Permalink: 2. Building codeanalyzer\" href=\"#2-building-codeanalyzer\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e2.1. Install Java 11 or above\u003c/h3\u003e\u003ca id=\"user-content-21-install-java-11-or-above\" class=\"anchor\" aria-label=\"Permalink: 2.1. Install Java 11 or above\" href=\"#21-install-java-11-or-above\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003col dir=\"auto\"\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eYou can list all available GraalVM versions with:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"sdk list java | grep sem\"\u003e\u003cpre\u003esdk list java \u003cspan class=\"pl-k\"\u003e|\u003c/span\u003e grep sem\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eYou should see the following:\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\" Semeru | | 21.0.2 | sem | | 21.0.2-sem\n | | 21.0.1 | sem | | 21.0.1-sem\n | | 17.0.10 | sem | | 17.0.10-sem\n | | 17.0.9 | sem | | 17.0.9-sem\n | | 11.0.22 | sem | installed | 11.0.22-sem\n | | 11.0.21 | sem | | 11.0.21-sem\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003e Semeru | | 21.0.2 | sem | | 21.0.2-sem\n | | 21.0.1 | sem | | 21.0.1-sem\n | | 17.0.10 | sem | | 17.0.10-sem\n | | 17.0.9 | sem | | 17.0.9-sem\n | | 11.0.22 | sem | installed | 11.0.22-sem\n | | 11.0.21 | sem | | 11.0.21-sem\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eInstall Java 11 or above (we'll go with 17.0.10-sem):\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"sdk install java 17.0.10-sem\"\u003e\u003cpre\u003esdk install java 17.0.10-sem\u003c/pre\u003e\u003c/div\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eSet Java 17 as the current Java version:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"sdk use java 17.0.10-sem\"\u003e\u003cpre\u003esdk use java 17.0.10-sem\u003c/pre\u003e\u003c/div\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e2.2. Build \u003ccode\u003ecodeanalyzer\u003c/code\u003e\u003c/h3\u003e\u003ca id=\"user-content-22-build-codeanalyzer\" class=\"anchor\" aria-label=\"Permalink: 2.2. Build codeanalyzer\" href=\"#22-build-codeanalyzer\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eClone the repository (if you haven't already) and navigate into the cloned directory.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eRun the Gradle wrapper script to build the project. This will compile the project using GraalVM native image.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"./gradlew fatJar\"\u003e\u003cpre\u003e./gradlew fatJar\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e2.3. Using \u003ccode\u003ecodeanalyzer\u003c/code\u003e\u003c/h3\u003e\u003ca id=\"user-content-23-using-codeanalyzer\" class=\"anchor\" aria-label=\"Permalink: 2.3. Using codeanalyzer\" href=\"#23-using-codeanalyzer\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThe jar will be built at \u003ccode\u003ebuild/libs/codeanalyzer-1.0.jar\u003c/code\u003e. It may be used as follows:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-text-vim-help notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Usage: java -jar /path/to/codeanalyzer.jar [-hvV] [--no-build] [-a=\u0026lt;analysisLevel\u0026gt;] [-b=\u0026lt;build\u0026gt;]\n [-i=\u0026lt;input\u0026gt;] [-o=\u0026lt;output\u0026gt;] [-s=\u0026lt;sourceAnalysis\u0026gt;]\nConvert java binary into a comprehensive system dependency graph.\n -i, --input=\u0026lt;input\u0026gt; Path to the project root directory.\n -s, --source-analysis=\u0026lt;sourceAnalysis\u0026gt;\n Analyze a single string of java source code instead\n the project.\n -o, --output=\u0026lt;output\u0026gt; Destination directory to save the output graphs. By\n default, the SDG formatted as a JSON will be\n printed to the console.\n -b, --build-cmd=\u0026lt;build\u0026gt; Custom build command. Defaults to auto build.\n --no-build Do not build your application. Use this option if\n you have already built your application.\n -a, --analysis-level=\u0026lt;analysisLevel\u0026gt;\n Level of analysis to perform. Options: 1 (for just\n symbol table) or 2 (for call graph). Default: 1\n -v, --verbose Print logs to console.\n -h, --help Show this help message and exit.\n -V, --version Print version information and exit.\n -t, --target-files For each file user wants to perform source analysis on top of existing analysis.json\n\"\u003e\u003cpre\u003eUsage: java -jar /path/to/codeanalyzer.jar \u003cspan class=\"pl-en\"\u003e[-hvV]\u003c/span\u003e \u003cspan class=\"pl-en\"\u003e[--no-build]\u003c/span\u003e [-a=\u003cspan class=\"pl-en\"\u003e\u0026lt;analysisLevel\u0026gt;\u003c/span\u003e] [-b=\u003cspan class=\"pl-en\"\u003e\u0026lt;build\u0026gt;\u003c/span\u003e]\n [-i=\u003cspan class=\"pl-en\"\u003e\u0026lt;input\u0026gt;\u003c/span\u003e] [-o=\u003cspan class=\"pl-en\"\u003e\u0026lt;output\u0026gt;\u003c/span\u003e] [-s=\u003cspan class=\"pl-en\"\u003e\u0026lt;sourceAnalysis\u0026gt;\u003c/span\u003e]\nConvert java binary into a comprehensive system dependency graph.\n -i, --input=\u003cspan class=\"pl-en\"\u003e\u0026lt;input\u0026gt;\u003c/span\u003e Path to the project root directory.\n -s, --source-analysis=\u003cspan class=\"pl-en\"\u003e\u0026lt;sourceAnalysis\u0026gt;\u003c/span\u003e\n Analyze a single string of java source code instead\n the project.\n -o, --output=\u003cspan class=\"pl-en\"\u003e\u0026lt;output\u0026gt;\u003c/span\u003e Destination directory to save the output graphs. By\n default, the SDG formatted as a JSON will be\n printed to the console.\n -b, --build-cmd=\u003cspan class=\"pl-en\"\u003e\u0026lt;build\u0026gt;\u003c/span\u003e Custom build command. Defaults to auto build.\n --no-build Do not build your application. Use this option if\n you have already built your application.\n -a, --analysis-level=\u003cspan class=\"pl-en\"\u003e\u0026lt;analysisLevel\u0026gt;\u003c/span\u003e\n Level of analysis to perform. Options: 1 (for just\n symbol table) or 2 (for call graph). Default: 1\n -v, --verbose Print logs to console.\n -h, --help Show this help message and exit.\n -V, --version Print version information and exit.\n -t, --target-files For each file user wants to perform source analysis on top of existing analysis.json\n\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e3. Installing \u003ccode\u003ecodeanalyzer\u003c/code\u003e as a native binary (once built, no JVM will be required for running \u003ccode\u003ecodeanalyzer\u003c/code\u003e)\u003c/h2\u003e\u003ca id=\"user-content-3-installing-codeanalyzer-as-a-native-binary-once-built-no-jvm-will-be-required-for-running-codeanalyzer\" class=\"anchor\" aria-label=\"Permalink: 3. Installing codeanalyzer as a native binary (once built, no JVM will be required for running codeanalyzer)\" href=\"#3-installing-codeanalyzer-as-a-native-binary-once-built-no-jvm-will-be-required-for-running-codeanalyzer\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo install \u003ccode\u003ecodeanalyzer\u003c/code\u003e, follow these steps:\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e3.1. Install GraalVM using SDKMan\u003c/h3\u003e\u003ca id=\"user-content-31-install-graalvm-using-sdkman\" class=\"anchor\" aria-label=\"Permalink: 3.1. Install GraalVM using SDKMan\" href=\"#31-install-graalvm-using-sdkman\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003col dir=\"auto\"\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eYou can list all available GraalVM versions with:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"sdk list java | grep graal\"\u003e\u003cpre\u003esdk list java \u003cspan class=\"pl-k\"\u003e|\u003c/span\u003e grep graal\u003c/pre\u003e\u003c/div\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eInstall GraalVM 17 or above (we'll go with 21.0.2-graalce):\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"sdk install java 21.0.2-graalce\"\u003e\u003cpre\u003esdk install java 21.0.2-graalce\u003c/pre\u003e\u003c/div\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eSet GraalVM 21 as the current Java version:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"sdk use java 21.0.2-graalce\"\u003e\u003cpre\u003esdk use java 21.0.2-graalce\u003c/pre\u003e\u003c/div\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e3.2. Build the Project\u003c/h3\u003e\u003ca id=\"user-content-32-build-the-project\" class=\"anchor\" aria-label=\"Permalink: 3.2. Build the Project\" href=\"#32-build-the-project\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eClone the repository (if you haven't already) and navigate into the cloned directory.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eRun the Gradle wrapper script to build the project. This will compile the project using GraalVM native image.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"./gradlew nativeCompile -PbinDir=$HOME/.local/bin\"\u003e\u003cpre\u003e./gradlew nativeCompile -PbinDir=\u003cspan class=\"pl-smi\"\u003e$HOME\u003c/span\u003e/.local/bin\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003eNote: \u003ccode\u003e-PbinDir\u003c/code\u003e is optional. If not provided, this command places the binaries in \u003ccode\u003ebuild/bin\u003c/code\u003e.\u003c/strong\u003e\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e3.3. Using \u003ccode\u003ecodeanalyzer\u003c/code\u003e\u003c/h3\u003e\u003ca id=\"user-content-33-using-codeanalyzer\" class=\"anchor\" aria-label=\"Permalink: 3.3. Using codeanalyzer\" href=\"#33-using-codeanalyzer\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eAssuming the path you provided in \u003ccode\u003e-PbinDir\u003c/code\u003e (in my case \u003ccode\u003e$HOME/.local/bin\u003c/code\u003e) is in your \u003ccode\u003e$PATH\u003c/code\u003e, after installation, you can use \u003ccode\u003ecodeanalyzer\u003c/code\u003e by following the below format:\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-text-vim-help notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"Usage: codeanalyzer [-hqV] [-d=\u0026lt;appDeps\u0026gt;] [-e=\u0026lt;extraLibs\u0026gt;] -i=\u0026lt;input\u0026gt;\n -o=\u0026lt;outDir\u0026gt;\nConvert java binary (*.jar, *.ear, *.war) to a neo4j graph.\n -d, --app-deps=\u0026lt;appDeps\u0026gt; Path to the application dependencies.\n -e, --extra-libs=\u0026lt;extraLibs\u0026gt;\n Path to the extra libraries.\n -h, --help Show this help message and exit.\n -i, --input=\u0026lt;input\u0026gt; Path to the input jar(s).\n -o, --output=\u0026lt;outDir\u0026gt; Destination directory to save the output graphs.\n -q, --quiet Don't print logs to console.\n -V, --version Print version information and exit.\"\u003e\u003cpre\u003eUsage: codeanalyzer \u003cspan class=\"pl-en\"\u003e[-hqV]\u003c/span\u003e [-d=\u003cspan class=\"pl-en\"\u003e\u0026lt;appDeps\u0026gt;\u003c/span\u003e] [-e=\u003cspan class=\"pl-en\"\u003e\u0026lt;extraLibs\u0026gt;\u003c/span\u003e] -i=\u003cspan class=\"pl-en\"\u003e\u0026lt;input\u0026gt;\u003c/span\u003e\n -o=\u003cspan class=\"pl-en\"\u003e\u0026lt;outDir\u0026gt;\u003c/span\u003e\nConvert java binary (*.jar, *.ear, *.war) to a neo4j graph.\n -d, --app-deps=\u003cspan class=\"pl-en\"\u003e\u0026lt;appDeps\u0026gt;\u003c/span\u003e Path to the application dependencies.\n -e, --extra-libs=\u003cspan class=\"pl-en\"\u003e\u0026lt;extraLibs\u0026gt;\u003c/span\u003e\n Path to the extra libraries.\n -h, --help Show this help message and exit.\n -i, --input=\u003cspan class=\"pl-en\"\u003e\u0026lt;input\u0026gt;\u003c/span\u003e Path to the input jar(s).\n -o, --output=\u003cspan class=\"pl-en\"\u003e\u0026lt;outDir\u0026gt;\u003c/span\u003e Destination directory to save the output graphs.\n -q, --quiet Don't print logs to console.\n -V, --version Print version information and exit.\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThere is a sample application in \u003ccode\u003esrc/test/resources/sample_apps/daytrader8/binaries/\u003c/code\u003e. You can use this to test the tool.\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"codeanalyzer -i src/test/resources/sample_apps/daytrader8/binaries/ \"\u003e\u003cpre\u003ecodeanalyzer -i src/test/resources/sample_apps/daytrader8/binaries/ \u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis will produce print the SDG on the console. Explore other flags to save the output to a JSON.\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eFAQ\u003c/h2\u003e\u003ca id=\"user-content-faq\" class=\"anchor\" aria-label=\"Permalink: FAQ\" href=\"#faq\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003col dir=\"auto\"\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eAfter making a few code changes, my native binary gives random exceptions. But, my code works perfectly with \u003ccode\u003ejava -jar\u003c/code\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe \u003ccode\u003ereflect-config.json\u003c/code\u003e is most likely out of date. Plese follow the below instructions:\u003c/p\u003e\n\u003cp dir=\"auto\"\u003ea. Build the fatjar using \u003ccode\u003e./gradlew fatJar\u003c/code\u003e\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eb. Run the following\u003c/p\u003e\n\u003cdiv class=\"highlight highlight-source-shell notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"java -agentlib:native-image-agent=config-output-dir=src/main/resources/META-INF/native-image-config -jar build/libs/codeanalyzer-1.0.jar -i src/test/resources/sample.applications/daytrader8/source -a 2 -v\"\u003e\u003cpre\u003ejava -agentlib:native-image-agent=config-output-dir=src/main/resources/META-INF/native-image-config -jar build/libs/codeanalyzer-1.0.jar -i src/test/resources/sample.applications/daytrader8/source -a 2 -v\u003c/pre\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003ec. Then build using the instructions in \u003ca href=\"/codellm-devkit/codeanalyzer-java/blob/v2.2.1/README.md#33-build-the-project\"\u003e§3.3\u003c/a\u003e.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003eThe problem should be resolved.\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eLICENSE\u003c/h2\u003e\u003ca id=\"user-content-license\" class=\"anchor\" aria-label=\"Permalink: LICENSE\" href=\"#license\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"Copyright IBM Corporation 2023, 2024\n\nLicensed under the Apache Public License 2.0, Version 2.0 (the \u0026quot;License\u0026quot;);\nyou may not use this file except in compliance with the License.\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \u0026quot;AS IS\u0026quot; BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\"\u003e\u003cpre lang=\"LICENSE\" class=\"notranslate\"\u003e\u003ccode\u003eCopyright IBM Corporation 2023, 2024\n\nLicensed under the Apache Public License 2.0, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003c/article\u003e","renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":null},"copilotInfo":null,"copilotAccessAllowed":false,"modelsAccessAllowed":false,"modelsRepoIntegrationEnabled":false,"csrf_tokens":{"/codellm-devkit/codeanalyzer-java/branches":{"post":"xYFkjNOnNO5yhWb2KisvgHtUgC_E_PbD_Z_ntrF30YI8VFkZtTO4euQXJGL5A1eGFmWShnPbEYlJC23jXSPd1g"},"/repos/preferences":{"post":"eNnKxDDwxek96h1r1fyVj7zD6ZfNlGakLFV64Izb-FD6UrzVWfxDn2lVPT4GxjxxwCH6XLOIfTZqTZKn-UWJ6w"}}},"title":"codeanalyzer-java/README.md at v2.2.1 · codellm-devkit/codeanalyzer-java","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-263cab1760dd.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-b84e9496fc59.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true}}}
0