user2661923
user2661923

Reputation: 113

Linux javac command erroring on wildcard in classpath

I am running Windows 7 with Java version 1.6.0_31-b05 on my PC, and my computerlab's network Linux (Fedora, possibly version 13) is running Java version 1.6.0_35-b10.

I have a C:\myproject (et al) directory, with src, lib, and bin subdirectories.

I have re-created the tree in Linux, under ../myproject (et al).

The computerlab network location is accessible from both DOS and Linux. In Linux, I first created the ../myproject/src, ../myproject/lib, and ../myproject/bin directories. Then, in DOS, I copied the necessary files from my C drive to ../myproject/src01 and ../myproject/lib01. Then, in Linux, I used the cp -av command to populate src and lib from src01 and lib01, respectively. Therefore, I don't think there is a Linux permissions problem.

In Linux, from the ../myproject/src location, issuing ls ../lib shows that the (sibling) lib directory does contain the JAR files. I have also tried the Linux javac command with an absolute path to the lib directory; no joy.
Similarly, I tried removing the quote (") marks from the -cp clause; no joy.

Could the problem be that I am running an old version of Fedora? If not, does any one have a hypothesis as to what the problem is?

Upvotes: 1

Views: 1528

Answers (1)

Gyro Gearless
Gyro Gearless

Reputation: 5279

Wildcard expansion may behave differently on Linux than on Windows: In Unixlike systems, it is the shells duty to perform the wildcard expansion before the arguments are passed to the executable; on Windows its each programs own duty to do wildcard expansion (if at all). In doubt replace javac with echo to see how the wildcards are actually expanded! And you should rather use the -sourcepath option to javac to define the source location (Can't tell if this actually works, it must have been 10+ years since i last used that...)

Upvotes: 2

Related Questions