9

Why am I unable to see networked drive on Windows 10 PC with Java Open Dialog. I have noticed a problem when running my Java application from IDE, the Open Dialog does not show my NAS (NetGear ReadyDuo mounted on Z:drive). Yet when I run the application outside of the IDE on the same machine using the same JVM it is okay.

In both cases I'm using Java 1.8.0_72 25.72-b15 64bit on Windows 10 10.0 amd64. I'm sure I didn't used to have this issue but don't know when it started occurring. Its not such a big issue for me if it doesn't show in the IDE because of the IDE, but I'm concerned the IDE may be irrelevant and that potential customers are also seeing this behaviour.

Screenshots below show what I see in the two circumstances

Shows networked drive Doesn't show networked drive

Paul Taylor
  • 13,411
  • 42
  • 184
  • 351
  • [This question might help](http://stackoverflow.com/questions/33640908/how-to-navigate-to-a-network-host-in-jfilechooser) – Hovercraft Full Of Eels Dec 18 '16 at 14:58
  • @HovercraftFullOfEels thats interesting but Im talking about a network share already mounted as Z:\ and it doesnt explain why its visible if I run program one way but not another – Paul Taylor Dec 20 '16 at 11:02
  • This isn't a solution but it could be a debug tip. Did you try running your IDE as admin and then run your app? Perhaps the IDE is quietly stifling permissions. – EngineerExtraordinaire Dec 21 '16 at 19:12
  • Can you post a debug log, please? – Samuel Tulach Dec 24 '16 at 12:00
  • What IDE are you using. And if you do `Open File` in your IDE from the menu, do you see you network drive? – serge Dec 27 '16 at 14:52
  • @serge Im using Jetbrains Intellij, I am running as adminsistrator but you are correct if I do FIle:Open it doesn't show the networked drives . Maybe I just need to update it Im still using 13.1.2 on Windows – Paul Taylor Jan 06 '17 at 16:55
  • Yeah I would update, and if it doesn't help maybe look into UAC, like Hani said – serge Jan 06 '17 at 17:31

4 Answers4

1

I have encountered this behaviour in other softwares, where the cause was, that the drive was not mapped persistent.

What i did to solve it: Map your Network Drive with the Windows Explorer GUI and mark "always connect".

or in cmd.exe (please try above 1st!):

net use z: \nas\media /user:usr pass /persistent:yes

Kind regards.

simon binz
  • 11
  • 2
  • hello. i'm new here. could you explain the downvote? did i understand the issue wrong or did it not work? because i'm pretty sure i know how to solve that... – simon binz Mar 09 '17 at 11:23
1

Solved issue, it seems if you mount a network drive using Windows Explorer, but then run the IDE with administrator privileges then you do not have permission to access the drive because now seen as separate user admin (even though I only have a single user) that wasn't given permission.

The way round is write create batch file to mount the network drive

i.e

net use z: \\nas\media /persistent:yes

and then right click on the batch file and select Run as Administrator

Don't know if there is an easier way.

Paul Taylor
  • 13,411
  • 42
  • 184
  • 351
  • I think you have permissions, but the "moint point" is just not visible (/ the drive letter is not mapped) for the elevated programs. ( I would suspect that this is for security reasons (if non-elevated could point C: to somewhere else it would be trivial to escalate privileges). See [my answer](https://stackoverflow.com/a/76412400/1870254) for an easier way that worked in one case where your solution also worked. – jan-glx Jun 06 '23 at 07:46
0

Its not possible for me to comment, so I have to ask here.

Did you tried to run your IDE with Administrator Rights? Maybe some minor 'problems' with UAC (User Account Control).

Hani
  • 104
  • 5
0

(At least in some cases,) there is an easier way: simply create a shortcut to the drive and save it somewhere accessible (e.g. on your desktop). Go through that shortcut to open files on the network drive from applications that don't show the network drive.

jan-glx
  • 7,611
  • 2
  • 43
  • 63