Indeed, Path.of was later introduced.

Conjecture: it was introduced for the sake of a consistent Foo.of style.

From the mailing list archive, this method was once called Path.get:

The main changes in are in Path and Paths in java.nio.file.

This patch copies the Paths.get() methods to static methods in Path.get() and modifies the former to call the latter respective methods. The Path specification is slightly cleaned up not to refer to Paths nor itself, e.g., “(see Path).” @implSpec annotations are added to Paths to indicate that the methods simply call their counterparts in Path.
...

This was later changed when Brian Goetz suggested it to be consistent with Foo.of:

Separately, Brian Goetz suggested off-list that it would be more consistent if these factory methods were named "of" so I assume the webrev will be updated to see how that looks.

Now to your last question: "In that case, it would be considered preferable on consistency/aesthetic grounds?"
In the initial mail Brian Burkhalter said that he updated all references to the new method in Path:

All source files in java.base are modified to change Paths.get() to Path.get() and to remove the import for Paths. ...

So I would therefore conclude that Path.of is indeed preferable to Paths.get.
Indeed, if you look at the Javadoc for Paths for Java 13 you will find this note:

API Note:
It is recommended to obtain a Path via the Path.of methods instead of via the get methods defined in this class as this class may be deprecated in a future release.

Answer from Johannes Kuhn on Stack Overflow
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › nio › file › Paths.html
Paths (Java Platform SE 8 )
April 21, 2026 - Converts a path string, or a sequence of strings that when joined form a path string, to a Path. If more does not specify any elements then the value of the first parameter is the path string to convert. If more specifies one or more elements then each non-empty string, including first, is considered to be a sequence of name elements (see Path) and is joined to form a path string.
🌐
Medium
medium.com › @AlexanderObregon › javas-paths-get-method-explained-9586c13f2c5c
Java’s Paths.get() Method Explained | Medium
September 8, 2024 - Understanding the difference between relative and absolute paths is crucial when working with Paths.get(). Paths in Java can either be absolute, meaning they specify the location of a file or directory from the root of the file system, or relative, ...
Discussions

java - Paths.get vs Path.of - Stack Overflow
Path.of was introduced later. Conjecture: it was introduced for the sake of a consistent Foo.of style. In that case, it would be considered preferable on consistency/aesthetic grounds? ... I think you are correct. A quick search over the java discussion lists brought up this: mail.openjdk.... More on stackoverflow.com
🌐 stackoverflow.com
File Paths on Linux (Pi) Vs Windows
From the Java Doc the listFiles() method returns null if the File object does not refer to a directory. https://docs.oracle.com/javase/6/docs/api/java/io/File.html#listFiles() I'd suggest testing the pictureDictory first: if (pictureDirectory.isDirectory()) { for (File f: pictureDirectory.listFiles()) // go through each file { } } Also the File class has a constructor that takes and parent (File or String) and a child (String). It is best practice to use the two arg constructor rather than form the filename via string concatenation: File pictureDirectory = new File(homeDir,"photos"); Also for what you are trying to do, the following should be enough to find the photos directory in the current directory: File pictureDirectory = new File("photos"); More on reddit.com
🌐 r/java
5
5
November 21, 2014
How did people set up java support?
The way I do it using vim.pack is the following. I have downloaded the current release of jdtls and put it in a directory where I have some language servers installed. This is configured as the global variable vim.g.language_server_dir . The on attach and Lombok part are optional. I recommend the java debug part though, it is really goodl ------------------------------------------------------------- -- => Java ------------------------------------------------------------- vim.pack.add({ 'https://github.com/mfussenegger/nvim-jdtls.git' }) --See https://github.com/eclipse/eclipse.jdt.ls#installation vim.lsp.config.jdtls = { root_dir = vim.fs.root(0, {'.git', '.hg', 'mvnw', 'gradlew' , 'build.gradle'}), cmd = { vim.g.language_server_dir .. "/jdt-language-server/bin/jdtls" , '--data=' .. vim.g.language_server_dir .. "/jdt-language-server/workspace-root/" , '--jvm-arg=-javaagent:' .. vim.g.language_server_dir .. '/lombok.jar', }, settings = { java = { -- See https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request signature_help = { enabled = true }, ['jdt.ls.lombokSupport'] = { enabled = true }, completion = { favoriteStaticMembers = { 'org.junit.Assert.*' , 'org.junit.Assume.*' }, importOrder = { 'java' , 'javax' , 'com' , 'org' , 'de' , 'lombok' } }, sources = { organizeImports = { starThreshold = 3, staticStarThreshold = 3 } }, maven = { downloadSources = true, }, references = { includeDecompiledSources = true, }, inlayHints = { parameterNames = { enabled = 'all', -- literals, all, none }, } }, }, on_attach = function (client, bufnr) if client.server_capabilities.documentSymbolProvider then require('nvim-navic').attach(client, bufnr) end return require('jdtls.setup')._on_attach(client, bufnr) end, init_options = { bundles = { vim.fn.glob(vim.g.language_server_dir .. '/java-debug/com.microsoft.java.debug.plugin/target/com.microsoft.java.debug.plugin-*.jar') } }, } vim.lsp.enable('jdtls') More on reddit.com
🌐 r/neovim
12
25
April 4, 2026
debian - How to specify filepath in java? - Stack Overflow
I have created a java application for "Debian Linux." Now I want that that application reads a file placed in the directory where the jar file of that application is specified. So what to specify at the argument of the File Object? ... What to specify as argument for the above statement to specify relative filepath representing the path ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Oracle
docs.oracle.com › en › java › javase › 11 › docs › api › java.base › java › nio › file › Paths.html
Paths (Java SE 11 & JDK 11 )
January 20, 2026 - java.nio.file.Paths · public final class Paths extends Object · This class consists exclusively of static methods that return a Path by converting a path string or URI. API Note: It is recommended to obtain a Path via the Path.of methods instead of via the get methods defined in this class as this class may be deprecated in a future release.
🌐
GeeksforGeeks
geeksforgeeks.org › java › java-nio-file-paths-class-in-java
java.nio.file.Paths Class in Java - GeeksforGeeks
March 12, 2021 - Returns a Path by converting given strings into a Path. If "more" doesn't specify any strings than "first" is the only string to convert. If "more" specify extra strings then "first" is the initial part of the sequence and the extra strings will be appended to the sequence after "first" separated by "/". ... // Java program to demonstrate // java.nio.file.Path.get(String first,String...
🌐
Dev.java
dev.java › learn › java-io › file-system › path
Working with Paths - Dev.java
January 25, 2023 - A Path instance contains the information used to specify the location of a file or directory. At the time it is defined, a Path is provided with a series of one or more names. A root element or a file name might be included, but neither are required.
🌐
Baeldung
baeldung.com › home › java › java io › java nio2 path api
Java NIO2 Path API | Baeldung
January 8, 2024 - A Path object contains the file name and directory list used to construct the path and is used to examine, locate, and manipulate files. The helper class, java.nio.file.Paths (in plural form) is the formal way of creating Path objects.
Find elsewhere
🌐
Capgemini
capgemini.com › home › careers › career paths › students and graduates
Graduate Programs| Students and Graduate Programs| Students and Graduates | Careers | Capgemini | Careers | Capgemini
March 11, 2026 - Career paths · BackCareer paths · Students and graduates · Experienced professionals · Executives · Our professions · Careers at Capgemini Engineering · Careers at Capgemini Invent · Join us · BackJoin us · Recruitment process · Interview tips · Job search ·
Top answer
1 of 1
74

Indeed, Path.of was later introduced.

Conjecture: it was introduced for the sake of a consistent Foo.of style.

From the mailing list archive, this method was once called Path.get:

The main changes in are in Path and Paths in java.nio.file.

This patch copies the Paths.get() methods to static methods in Path.get() and modifies the former to call the latter respective methods. The Path specification is slightly cleaned up not to refer to Paths nor itself, e.g., “(see Path).” @implSpec annotations are added to Paths to indicate that the methods simply call their counterparts in Path.
...

This was later changed when Brian Goetz suggested it to be consistent with Foo.of:

Separately, Brian Goetz suggested off-list that it would be more consistent if these factory methods were named "of" so I assume the webrev will be updated to see how that looks.

Now to your last question: "In that case, it would be considered preferable on consistency/aesthetic grounds?"
In the initial mail Brian Burkhalter said that he updated all references to the new method in Path:

All source files in java.base are modified to change Paths.get() to Path.get() and to remove the import for Paths. ...

So I would therefore conclude that Path.of is indeed preferable to Paths.get.
Indeed, if you look at the Javadoc for Paths for Java 13 you will find this note:

API Note:
It is recommended to obtain a Path via the Path.of methods instead of via the get methods defined in this class as this class may be deprecated in a future release.

🌐
Medium
medium.com › javarevisited › understanding-the-java-nio-file-path-class-in-java-ff1b149b2d65
Understanding the java.nio.file.Path Class in Java | by WhatInDev | Javarevisited | Medium
January 19, 2025 - The java.nio.file.Path class is a cornerstone of the Java NIO (New Input/Output) package, introduced in Java 7. It provides an efficient way to represent and manipulate file and directory paths.
🌐
Oracle
docs.oracle.com › en › java › javase › 26 › docs › api › java.base › java › nio › file › Paths.html
Paths (Java SE 26 & JDK 26)
March 16, 2026 - Converts a path string, or a sequence of strings that when joined form a path string, to a Path.
🌐
Reddit
reddit.com › r/java › file paths on linux (pi) vs windows
r/java on Reddit: File Paths on Linux (Pi) Vs Windows
November 21, 2014 -

So I wrote a pretty basic piece of Photo Gallery software in java. Basically it looks through a folder named "photos" that is in the same directory as the jar file, and displays the photos one by one. Now this works perfectly in windows, but when I move it over to my pi and run it in the command line I get a NullPointerException at this line

// open our picture folder
	String homeDir = new File(".").getAbsolutePath();
	File pictureDirectory = new File(homeDir + File.separator     + "photos" + File.separator);
	for (File f: pictureDirectory.listFiles()) // go through each file

The NullPointerException refers to the line with the for loop. This program works perfectly on my windows laptop, and I've looked online and done everything I've found to make it work on Linux too but nothing seems to help. This is my first time ever working on a Linux device so does someone more experienced in this field see my error?

EDIT: Solved Thank you all for your help

I was simply using File pictureDirectory = new File("photos");

In Windows and it works fine but in Linux I had to change it to

File pictureDirectory = new File("Desktop/PhotoGallery/photos"); 

Because for some reason it sensed my home directory as being /home/pi rather than the location of my jar file. This wasn't the perfect solution for me but it got the job done so it'll work for now.

🌐
Rahul Shetty Academy
rahulshettyacademy.com
Rahul Shetty Academy | QA Automation, Playwright, AI Testing & QA Online Training
Transform your QA career with exclusive practice applications. 500K+ students practicing automation testing skills.
🌐
Reddit
reddit.com › r/neovim › how did people set up java support?
r/neovim on Reddit: How did people set up java support?
April 4, 2026 -

I just got a new job where we use java, and I was trying to set up neovim, but I can't get it to work properly.

So I simply used lazyvim, it's what I use on my main PC and it always worked perfectly, admittedly with relatively small java projects. Now at work I have a massive java grade java project with a bunch of modules, and I tried to use jdtls (from lazy extras), which didn't quite work, and then I tried making a java.lua file to tweak some things.

No matter what I did, jdtls building would always get stuck at 86%, at which point basic lap functions become basically unusable, for example K or gd.

Is lazyvim the issue? Should I make my own thing from scratch? Is jdtls the issue? What did you guys do? I feel like I tried everything under the sun and I couldn't get it to work.

Top answer
1 of 8
22
The way I do it using vim.pack is the following. I have downloaded the current release of jdtls and put it in a directory where I have some language servers installed. This is configured as the global variable vim.g.language_server_dir . The on attach and Lombok part are optional. I recommend the java debug part though, it is really goodl ------------------------------------------------------------- -- => Java ------------------------------------------------------------- vim.pack.add({ 'https://github.com/mfussenegger/nvim-jdtls.git' }) --See https://github.com/eclipse/eclipse.jdt.ls#installation vim.lsp.config.jdtls = { root_dir = vim.fs.root(0, {'.git', '.hg', 'mvnw', 'gradlew' , 'build.gradle'}), cmd = { vim.g.language_server_dir .. "/jdt-language-server/bin/jdtls" , '--data=' .. vim.g.language_server_dir .. "/jdt-language-server/workspace-root/" , '--jvm-arg=-javaagent:' .. vim.g.language_server_dir .. '/lombok.jar', }, settings = { java = { -- See https://github.com/eclipse/eclipse.jdt.ls/wiki/Running-the-JAVA-LS-server-from-the-command-line#initialize-request signature_help = { enabled = true }, ['jdt.ls.lombokSupport'] = { enabled = true }, completion = { favoriteStaticMembers = { 'org.junit.Assert.*' , 'org.junit.Assume.*' }, importOrder = { 'java' , 'javax' , 'com' , 'org' , 'de' , 'lombok' } }, sources = { organizeImports = { starThreshold = 3, staticStarThreshold = 3 } }, maven = { downloadSources = true, }, references = { includeDecompiledSources = true, }, inlayHints = { parameterNames = { enabled = 'all', -- literals, all, none }, } }, }, on_attach = function (client, bufnr) if client.server_capabilities.documentSymbolProvider then require('nvim-navic').attach(client, bufnr) end return require('jdtls.setup')._on_attach(client, bufnr) end, init_options = { bundles = { vim.fn.glob(vim.g.language_server_dir .. '/java-debug/com.microsoft.java.debug.plugin/target/com.microsoft.java.debug.plugin-*.jar') } }, } vim.lsp.enable('jdtls')
2 of 8
5
In my experience working on a large java codebase in neovim is not as good as it is e.g. in intellij. I rememver opening call hierachies and it took ~5secs to scan for callers. In intellij it is nearly instant which is why I‘m still using it. Can someone proof me wrong and java in neovim works decent enough nowadays? I tweaked some memory consumption parameter back then.
🌐
Roadmap
roadmap.sh › java
Learn to become a modern Java developer
January 27, 2026 - Another factor that makes Java Development a great career choice is the strong community and endless number of learning resources. With countless training programs, open-source projects, and frameworks, developers can constantly upgrade their skills and stay relevant in a rapidly evolving industry. The best part about this career path is that, given the high enterprise demand, it offers many opportunities for growth, exposure to innovative technologies, and the chance to work on challenging large-scale projects.
🌐
Kubernetes
kubernetes.io › docs › concepts › services-networking › ingress
Ingress | Kubernetes
November 24, 2025 - Both the host and path must match the content of an incoming request before the load balancer directs traffic to the referenced Service.
🌐
ServiceNow Community
servicenow.com › community › sysadmin-forum › new-to-the-game › td-p › 3531548
New to the game - ServiceNow Community
April 24, 2026 - Start with the CSA and then choose your direction based on your interests — whether as an Admin, Developer, Business Analyst, Change Manager, or Project Manager. A strong foundation will give you the flexibility to explore any of these paths.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › nio › file › Path.html
Path (Java Platform SE 8 )
April 21, 2026 - Java™ Platform Standard Ed. 8 ... An object that may be used to locate a file in a file system. It will typically represent a system dependent file path.
🌐
Oracle
java.com › en › download › help › path.html
How do I set or change the PATH system variable?
In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK. Reopen Command prompt window, and run your java code.
🌐
Swagger
swagger.io › specification
OpenAPI Specification - Version 3.1.0 | Swagger
Path templating refers to the usage of template expressions, delimited by curly braces ({}), to mark a section of a URL path as replaceable using path parameters.