Comparing Node.js to Java is somewhat like comparing apples to oranges and more like comparing a dictionary to a grammar textbook (thanks scriptin).
Java is a language (not a framework) to which an implementation of the JDK (i.e. Oracle JDK vs. OpenJDK) can see fit how to implement the underlying language constructs (threads, I/O, etc.).
The precise phrasing is - you cannot spawn (or manage) threads in nodejs.
can someone please compare these threads to a java environment by comparing their resource consumption on the server
In a Java environment, you can spawn threads in user code, but it should be noted that the underlying mechanisms that spawn the threads (i.e. the JVM C code) are the same system API's called to create and manage the threads in Node.js. In other words, both will call
pthread_create for POSIX platforms or
CreateThread for Windows. In this way, the resources used are the same on that front.
Where this thread model and resource usage differs is when a user wants to create more than 1 thread; multiple threads might mean context switches which can incur additional resources. This is true of any language though, since threading is an OS level concept and not something a language need support, so if you (as the developer) are building a multi-threaded application, you would (should) be aware of these caveats and build your code accordingly (i.e. handle the resources/threads such that the application has as little context switching as feasible).
Continuing from that, you state
as I also hear a lot about how nodejs is much less consuming than java.
This question cannot be directly (read, easily) answered since a simple Node.js app that were ported to Java (or vice versa) could result in varying resource usage based on a slew of different factors and ultimately you would have to do the testing yourself to see which would be better for that scenario.
To this though, the "less consuming" quote is probably referring more to the fact that running a Java based applet would require the Java Virtual Machine and the Java environment, which do consume substantial amounts of resources (for different reasons) compared to Node.js (which runs as a "native" app), but just because something consumes more resources does not mean it's "worse". And this is why additional testing would need be done to confirm.
I hope that can help add clarity.