Skip to main content

Running Java from a shared folder.

2 replies [Last post]
doc_imaging
Offline
Joined: 2006-09-06
Points: 0

How do you run JAVA from a client station off a shared folder on a Windows server? I know it can be done, so you do not need to install Java on the client stations. The Java application runs fine on the server. I tried running it on the shared server folder, on a client station and I get this message: 'java' is not recognized as an internal or external command,operable program or batch file. Does anyone know what my problem is?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
joeys
Offline
Joined: 2004-04-07
Points: 0

This is something we do in our production environment for all of our java applications. It provides an easy way to deploy java application without installing java on any computer other than a shared server.

Here is an example of a bat file for executing the application. There are many different ways of doing this so experiment to see what works for you.

set JAVA_HOME=\\[servername]\[sharedfolder]\j2sdk\jdk1.5.0_04
set CLASSPATH= "the jar file or the directory with the classes"
%JAVA_HOME%/bin/javaw -cp "%CLASSPATH%" [the fully qualified name of the class with the main method]

klopperq
Offline
Joined: 2005-09-23
Points: 0

The error that you got would probably indicate that the file java.exe is not on your PATH.

Not sure if this will work (as in I have not actually tried it), but have you tried setting the JAVA_HOME environment variable explicitly. You should also put the bin directory inside JAVA_HOME on your PATH (so you can find java.exe).

I realize that having to do settings on the client PC may be exactly what you are trying to avoid......

Message was edited by: klopperq