Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > a java classpath question

Reply
Thread Tools

a java classpath question

 
 
Arne Vajh°j
Guest
Posts: n/a
 
      12-30-2012
On 12/30/2012 2:50 PM, John L. wrote:
> On Friday, December 28, 2012 12:07:39 PM UTC-5, zyng wrote:
>> Hi: My Java program is started by using somebody's shell script.
>>Inside his script: java -classpath his_lib/'*' Main However, I also wish
>>to set Java's classpath for my code to work and I am not allowed to
>>change his script.(He: actually is a company. My program is running
>>inside this company's main frame). So when JVM starts, the true
>>classpath is my_lib/'*';his_lib/'*'. Is that possible to do? Thank you.

>
> At the risk of stating the obvious, perhaps set the %CLASSPATH%
> environment variable (or its Unix equivalent) prior to invoking your
> colleague's script.


The -cp argument override CLASSPATH env - it does not supplement it.

Arne

 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      12-30-2012
On 12/30/2012 10:53 AM, Roedy Green wrote:
> On Fri, 28 Dec 2012 09:07:39 -0800 (PST), zyng <(E-Mail Removed)>
> wrote, quoted or indirectly quoted someone who said :
>> My Java program is started by using somebody's shell script. Inside his script:
>>
>> java -classpath his_lib/'*' Main

>
> you could write a dummy java program that execs your real program.


OP could do that.

But if is not an option to change the shell script, then it does
not help.

If it is an option to change the shell script, then the dummy
program is not needed.

Arne


 
Reply With Quote
 
 
 
 
Arne Vajh├Şj
Guest
Posts: n/a
 
      12-30-2012
On 12/30/2012 3:49 PM, Martin Gregorie wrote:
> On Sun, 30 Dec 2012 11:50:48 -0800, John L. wrote:
>
>> On Friday, December 28, 2012 12:07:39 PM UTC-5, zyng wrote:
>>> Hi: My Java program is started by using somebody's shell script. Inside
>>> his script: java -classpath his_lib/'*' Main However, I also wish to
>>> set Java's classpath for my code to work and I am not allowed to change
>>> his script.(He: actually is a company. My program is running inside
>>> this company's main frame). So when JVM starts, the true classpath is
>>> my_lib/'*';his_lib/'*'. Is that possible to do? Thank you.

>>
>> At the risk of stating the obvious, perhaps set the %CLASSPATH%
>> environment variable (or its Unix equivalent) prior to invoking your
>> colleague's script.

>
> At the brisk of stating another obvious point, whats wrong with this
> summary of the situation?
>
> 1) the owner of the computer wants your program to be run on it.
> 2) an existing script must be changed for your program to run
> 3) the computer's sysadmins won't let anybody else change scripts
> on production systems. (a fairly common situation).
>
> However this leaves the obvious outstanding question: why won't the
> sysadmins, i.e. 'the company', make the changes needed for your program
> to run?


Do you read Dilbert?



Arne


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
.classpath file instead of the CLASSPATH Environment variable. dontspammenow@yahoo.com Java 2 03-02-2008 08:19 AM
Java Classpath - Simple Question RalphLeon Java 3 08-03-2007 06:56 PM
problem compiling project, classpath in xml ".classpath" "<classpathentry...>" jameshanley39@yahoo.co.uk Java 2 03-02-2007 12:37 PM
while using javac -classpath some.jar some.java (Where does classpath get stored?) Gabe Java 3 08-27-2004 07:02 PM
CLASSPATH, -cp and -classpath misunderstanding? Flip Java 3 02-09-2004 10:09 PM



Advertisments