Sunday, May 12, 2024
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 674  / 3 Years ago, fri, september 3, 2021, 8:07:42

Is it possible to directly bind all *.class files with the java command?



At the moment I run java-files like:



java myprog args


Is it possible to simple type



myporg args


ok, this is not a very important question, but it would be nice to know.


More From » command-line

 Answers
2
java -cp "/path/to/package/directory/or/directory/with/classes:/another/path" <class_name> [args]


you can use alias



alias <prog_name>='java -cp '"/path"' <class_name>'


and then



<prog_name> [args]

[#35556] Sunday, September 5, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
fertion

Total Points: 436
Total Questions: 121
Total Answers: 156

Location: England
Member since Sun, May 21, 2023
1 Year ago
fertion questions
Thu, Mar 9, 23, 06:46, 1 Year ago
Thu, Jun 17, 21, 01:06, 3 Years ago
Mon, Jun 13, 22, 07:30, 2 Years ago
Fri, Mar 10, 23, 12:13, 1 Year ago
;