• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with classpath

 
Velika Srbija
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An example that doesn't work OK:
C:\Temp\Program Files\Java
java -jar myJAR.jar
java.security.AccessControlException: access denied (java.io.FilePermission \C:\Temp\Program Files\Java with Files\Java\myJAR.jar read)
An example that works OK:
C:\Temp\Java
java -jar myJAR.jar

It seems that starting my myJAR.jar archive fails when started in a folder that has a path containing spaces. How could I overcome this problem. I need to use folder ith spaces in their names!
 
Sloan Bowman
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You simple need to type this "C:\Program Files\Java\bin\java -jar myJar.jar" this will solve the space issues.
 
Sainudheen Mydeen
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which OS you are using?
-------------------
Sainudheen
 
Velika Srbija
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using win 2000 Professional.
I've already tryed with quotation marks, but that failed.
--------------------------
One very concrete example:
Extract Batik-1.5 zip archive somewhere inside "Program Files" folder,
and try to run batik-squiggle.jar tool.
 
Sainudheen Mydeen
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
If you mean to say you are unable to navigate to a directory which has a space in its name, you may open the DOS prompt using cmd instead of command.
---------------------
Sainudheen
 
Marilyn de Queiroz
Sheriff
Posts: 9062
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you can substitute a ~1 after the first six letters. For example:

C:\Temp\Program Files\Java>java -jar myJAR.jar

becomes

C:\Temp\Progra~1\Java>java -jar myJAR.jar
 
Velika Srbija
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this.
Here is what I have done:
First, I had opened Command window and changed directory like:
C:\>cd Program Files
C:\Program Files>cd Java
C:\Program Files\Java>cd Batik-1.5
C:\Program Files\Java\Batik-1.5>java -jar batik-squiggle.jar
An exception occurs.
But if I extract Batik-1.5.zip archive into C:\Temp directory, everything works OK:
C:\>cd Temp
C:\Temp> cd Batik-1.5
C:\Temp\Batik-1.5>java -jar batik-squiggle.jar
The batik-squiggle application runs OK.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic