Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Adding .jar files to client's jre

Original Message
Name: jb489
Date: November 19, 2007 at 08:55:08 Pacific
Subject: Adding .jar files to client's jre
OS: windows xp
CPU/Ram: centrino
Model/Manufacturer: fujitsu siemens
Comment:
Hi all,

first time using this site. I have a problem. I have a java application i have finished, which I then put into installshield. Now the program has an emailer which uses the MAIL.JAR and ACTIVATION.jar libraries which are not standard with the jre but still from Sun.

I want to copy and paste these libraries into the %JAVAHOME%\lib\ext folder found on the client's pc and need an automated way of doing this since implementation will be on more than one pc.

I have tried to use a batch file but am having a problem between these lines.

::Convert long path (with spaces) into a short path
for %%x in ("%JavaHome%") do set JavaHome=%%~dpsx
echo Java home path (short path, no spaces) = %JavaHome%

before this piece of batch file code is implemented, the location of the java runtime environment is good except for the spaces between 'Program files', etc. After it is implemented it takes off the final folder.

Example:

before batch file code: C:\Program Files\Java\jre1.6.0_03
after batch file code: C:\PROGRA~1\Java\

it leaves out the "jre1.6.0_03"

I know it might be something simple, but as I said, I am new to batch files and have not found anything on the net. :(

Any help will be considered a great help, even without use of batch files completely.

Thanks


Report Offensive Message For Removal


Response Number 1
Name: IVO
Date: November 19, 2007 at 09:33:39 Pacific
Subject: Adding .jar files to client's jre
Reply: (edit)
Replace

=%%~dpsx

with

=%%~dpsnx


Report Offensive Follow Up For Removal

Response Number 2
Name: Razor2.3
Date: November 19, 2007 at 19:53:11 Pacific
Subject: Adding .jar files to client's jre
Reply: (edit)
Or, you know, don't worry about about it being a short name or a long name.

Report Offensive Follow Up For Removal

Response Number 3
Name: klint
Date: November 20, 2007 at 04:34:27 Pacific
Subject: Adding .jar files to client's jre
Reply: (edit)
Replace %%~dpsx with just %%~sx

This is because %JAVAHOME% expands into a directory path, and the last-level e.g. ("jdk1.6.01_a") is treated by the "for" command as a name, while the prefix is treated as the directory. If you want the full path to the JAVAHOME directory, just get it to give you the full path by specifying just %%~sx.

I wouldn't recommend using %%~dpsnx because, if the last part is, let's say, "jdk1.6", then the ".6" will be treated as an extension and will be stripped off. If you use just %%~sx, it will be kept.

But, as Razor says, why bother? It is quite common to allow spaces in installation scripts. They should be able to handle them.

Also, why are you copying the jar files in the users' JDK directories? What about users who don't have JDKs installed (they won't, if they are not developers) but only have JREs? Perhaps the jars should go where the rest of your application is?


Report Offensive Follow Up For Removal




Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Adding .jar files to client's jre

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




XP Installed to G?

exessive internet traffic

ZoneAlarm Question. Blocked Connect

Windows Live Messenger Problem

Delete $Uninstall after SP3 updates


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC