Though it’s probably reccomended one uses and IDE for coding advanced java projects, I personally prefer running almost entirely command-line (using gedit as a text-editor). So please don’t just tell me “Just use eclipse!” or something 😛
My question is what the method of creating a package in java is by a command.
I’m not talking about packaging an application that runs in the command line, I’m talking about making a package in the command line. Am I making a text file? Am I making a directory?
Relatedly, how does one link to related libs and natives without use of an IDE?
I know I’m being really awkward here, but I really prefer the control one gets working in command line.
packages are just directories on the filesystem.
so your package:
com.mycompany.utilcorresponds to a directorycom/mycompany/util.When running and compiling etc your current workding directory should be where that top directory is located.
To include libraries, include them in your classpath when compiling and running. For example make a Project directory
myprojectand under that have your java-files and packages undermyproject/src/and libraries that you use undermyproject/libs/Then when your current workding directory is
myprojectexecutejava -cp .:libs/*.jaror the same withjavac.But I suggest you look into using ant or maven.