Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

how to adjust .lnk file to set classpath where length is exceeding 255 characters

Posted on 2008-11-10
19
Medium Priority
?
410 Views
Last Modified: 2013-12-05
I have an java application run on MC3000 device by using a .lnk file. The problem is that when I set the classpath to a specific directory it is exceeding 255 characters. The content of .lnk file is as follows:

i want to know whether we have any particular way to set the classpath for the jars without using the .lnk file such that we only mention to run the main class in the lnk file


497#"\Application\CrEme\bin\CrEme.exe" -Of -classpath \Application\Picking\VMclasses.zip;\Application\Picking\saaj.jar;\Application\Picking\xerces.zip;\Application\Picking\commons-logging.jar;\Application\Picking\axis.jar;\Application\Picking\axis-ant.jar;\Application\Picking\jaxrpc.jar;\Application\Picking\jndi.jar;\Application\Picking\log4j-1.2.8.jar;\Application\Picking\wsdl4j.jar;\Application\Picking\commons-discovery.jar;\Application\Picking\picking.jar com.vuitton.picking.startup.Bootstrap

Open in new window

0
Comment
Question by:AnupKumar_B
  • 11
  • 8
19 Comments
 
LVL 7

Expert Comment

by:myhc
ID: 22928584
On the link, what happens if you make the Work in folder equal: "\Application\Picking\"
you can the take the "\Application\Picking\" off all the extra sections, if you understand.
(Not the first one)
#"\Application\CrEme\bin\CrEme.exe" -Of -classpath VMclasses.zip;saaj.jar;xerces.zip;commons-logging.jar;axis.jar;axis-ant.jar;jaxrpc.jar;jndi.jar;log4j-1.2.8.jar;wsdl4j.jar;commons-discovery.jar;picking.jar com.vuitton.picking.startup.Bootstrap
 

Open in new window

0
 
LVL 7

Expert Comment

by:myhc
ID: 22928592
Or rename the folders to shorter names "\Application\" could be "\app\"
Or move all the files into the same folder if thats not an issue.
0
 

Author Comment

by:AnupKumar_B
ID: 22929415
Thanks for the response

If I remove "\Application\Picking" before each JAR path in the lnk file......I need to put all these JARS in the root folderin the device . As it is required to specifically put these files inside "\Application\Picking" could there be any other solution to set the path.
I have tried out  different ways like:

But when I run the application the path "\Application\Picking\config\" is not identified and it results in an error saying NoClassDefFound error for the specified classes required from the above JARS
183#"\Windows\CrEme\bin\CrEme.exe" -Of -classpath .;\Application\Picking\;\Application\Picking\config\;\Application\Picking\resource\;\Application\Picking\picking.jar com.vuitton.picking.startup.Bootstrap

Open in new window

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 7

Expert Comment

by:myhc
ID: 22929455
You could add the path as a windows VAR.
Add to the "set path"
so they will look something like ;%picking%\saaj.jar

0
 

Author Comment

by:AnupKumar_B
ID: 22929545
yes I assume that this may be the most probable solution, but I am not able to locatw where to set/create a new windows VAR on the MC3000 device

Could you please help in settjng up a VAR in Windows CE for this device.

Thanks for your response
0
 
LVL 7

Expert Comment

by:myhc
ID: 22929586
In windows XP you need to add an Environment Variable.
To do this goto Control Panel / System, then the Advanced tab.
At the bottom is the button for Environment Variabls. Click it

Now im going to say we should set this up as a system variable so,
click new at the bottom of the screen.

name = picking
value = c:\folder1\folder2\application\picking

Click OK and restart the computer.
0
 
LVL 7

Expert Comment

by:myhc
ID: 22929595
What version of CE is running on the device
0
 
LVL 7

Expert Comment

by:myhc
ID: 22929639
Within windows XP (might be the same for CE)

Varables are held in the registy at
HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Control\ Session Manager\ Environment
0
 
LVL 7

Expert Comment

by:myhc
ID: 22929720
Or you could create a .bat file with the string inside.  Then just link to the .bat file
0
 

Author Comment

by:AnupKumar_B
ID: 22929815
This device uses Windows CE 5.0.

But i am unable to find the regstry editor for this version of windows, not even tringing "regedit" or any other command does work

Could you please help me with this.
Thanks for your response
0
 

Author Comment

by:AnupKumar_B
ID: 22929834
I was aware of creating a new environment variable in Windows XP......I  initially checked for this option on the devise but I have not even able to locate the "Environment variables" option in Control panel/system
0
 
LVL 7

Expert Comment

by:myhc
ID: 22929865
I also have a CE5.0 hand held. (MX7)

It has regedit on it...  I have attched.

RegEdit
0
 
LVL 7

Expert Comment

by:myhc
ID: 22929961
OK i can't find it the regisrty or anything.  I found DOS environment variable in CE 5 but they are empty.

I think your going to have to use a .bat file.

Is that an option?
0
 

Accepted Solution

by:
AnupKumar_B earned 0 total points
ID: 22930448
Thank you for this solution.  

yes I think using a .bat file and invoking it would help.... I am trying to run the batch file to set the classpath from the shortcut(.lnk file). Is this the right procedure? i do not have much knowledge on .lnk files and the commands to invoke .bat files from the short cut file Can u please help me in this regard

0
 

Author Comment

by:AnupKumar_B
ID: 22930514
Just for the purpose of testing......I have tried setting the classpath to all the JARS from command prompt...and then started the application (I mean ran the Bootstrap class from jar).....but I get the same errors in console.....which occur when the JARS are not found in the classpath.....i feel this is because the classpath set from commandprompt is not recognised when we run the application using the lnk file.(I have modified the lnk file as shown:)
183#"\Windows\CrEme\bin\CrEme.exe" -Of -classpath .;\Application\Picking\config\;\Application\Picking\resource\;\Application\Picking\picking.jar com.vuitton.picking.startup.Bootstrap

Open in new window

0
 
LVL 7

Expert Comment

by:myhc
ID: 22930563
You don't even need a .lnk file. You can just run the .bat file.

bat file should read:
START "c:\Application\CrEme\bin\CrEme.exe" -Of -classpath c:\Application\Picking\VMclasses.zip;c:\Application\Picking\saaj.jar;c:\Application\Picking\xerces.zip;c:\Application\Picking\commons-logging.jar;c:\Application\Picking\axis.jar;c:\Application\Picking\axis-ant.jar;c:\Application\Picking\jaxrpc.jar;c:\Application\Picking\jndi.jar;c:\Application\Picking\log4j-1.2.8.jar;c:\Application\Picking\wsdl4j.jar;c:\Application\Picking\commons-discovery.jar;c:\Application\Picking\picking.jar com.vuitton.picking.startup.Bootstrap

Open in new window

0
 
LVL 7

Expert Comment

by:myhc
ID: 22930761
does your string work if you put it in RUN?
0
 

Author Comment

by:AnupKumar_B
ID: 22937343
Hi I have tried using the .bat file with the code as specified in your previous comment ......but I am not able to start the application ...i think START command is not able to run the application.....I even tried to generate a .log file to generate what error was occuring...but i was not able to generate the log
0
 

Author Comment

by:AnupKumar_B
ID: 22937381
Hi Thank You for the .bat solution.  It works!! I am sorry as I had not properly written the .bat file previously.....the code provided is as follows:
START "\Windows\CrEme\bin\CrEme.exe" -Of -classpath \Application\Picking\VMclasses.zip;\Application\Picking\saaj.jar;\Application\Picking\xerces.zip;\Application\Picking\commons-logging.jar;\Application\Picking\axis.jar;\Application\Picking\axis-ant.jar;\Application\Picking\jaxrpc.jar;\Application\Picking\jndi.jar;\Application\Picking\log4j-1.2.8.jar;\Application\Picking\wsdl4j.jar;\Application\Picking\commons-discovery.jar;\Application\Picking\picking.jar com.vuitton.picking.startup.Bootstrap
 

Open in new window

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Server 2003 introduced persistent Volume Shadow Copies and made 2003 a must-do upgrade.  Since then, it's been a must-implement feature for all servers doing any kind of file sharing.
Unable to change the program that handles the scan event from a network attached Canon/Brother printer/scanner. This means you'll always have to choose which program handles this action, e.g. ControlCenter4 (in the case of a Brother).
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Suggested Courses

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question