Unable to run .jar (Java File) from network drive

We are trying to run a .jar file from a network location and we keep getting the error "Error: Unable to access jarfile".  We have tried linux and window shares so it is not a rights issue. We can not copy it over to run it because all the files with it are huge. Here is the command we are trying. I understand that the .jar file is trying to run on the network drive is there a way around this? Thanks!

 java -Xmx768m -jar "\\fs1\groups\bios\program1.jar" -b \\192.168.15.20\Transfer\run.xml

Open in new window


-Windows Pro 10 x64
LVL 8
ITSysTechSenior Systems AdministratorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
What happens when you do this?

copy "\\fs1\groups\bios\program1.jar"  .

Open in new window

0
ITSysTechSenior Systems AdministratorAuthor Commented:
It works and says "1 file(s) copied"
0
CEHJCommented:
OK. I can only think that copy/cmd.exe is SMB-aware and java.exe is not. You might have to map that network share to a drive letter and use a path with that in it
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Shaun VermaakTechnical Specialist/DeveloperCommented:
Does this work is a batch
@echo off
copy "\\fs1\groups\bios\program1.jar" %temp% /y
copy "\\192.168.15.20\Transfer\run.xml" %temp% /y
java -Xmx768m -jar "%temp%\program1.jar" -b "%temp%\Transfer\run.xml"

Open in new window

0
ITSysTechSenior Systems AdministratorAuthor Commented:
Thanks for the code Shaun. However, It didn't seem to work for some reason. I received a different error though.

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/logging/log4j/core/Layout
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.privateGetMethodRecursive(Unknown Source)
        at java.lang.Class.getMethod0(Unknown Source)
        at java.lang.Class.getMethod(Unknown Source)
        at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.core.Layout
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)

Open in new window

0
CEHJCommented:
It did work (i've already proved you can copy files). Or you wouldn't have that error. You're missing jar dependencies
0
Shaun VermaakTechnical Specialist/DeveloperCommented:
Perhaps
@echo off
robocopy "\\fs1\groups\bios\" "%temp%" /e
copy "\\192.168.15.20\Transfer\run.xml" %temp% /y
java -Xmx768m -jar "%temp%\program1.jar" -b "%temp%\Transfer\run.xml"

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.