Friday, May 3, 2024
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 671  / 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
;