Index: /CKPackager/trunk/ckpackager.js
===================================================================
--- /CKPackager/trunk/ckpackager.js	(revision 2887)
+++ /CKPackager/trunk/ckpackager.js	(revision 2888)
@@ -11,51 +11,8 @@
 importClass( java.io.FileWriter );
 
-var CKPACKAGER =
-{
-	dir : (function()
-		{
-			var packagerDir = new File( System.getProperty( 'java.class.path' ) );
-			return packagerDir.getParent();
-		})(),
+var jarPath = JavaAdapter(org.mozilla.javascript.Parser)["class"].getResource("/org/mozilla/javascript").toString();
+var packagerPath = jarPath.replaceFirst( "^jar:", '' ).replaceFirst( "\/js\.jar\!\/org\/mozilla\/javascript$", '');
 
-	getPackPath : function( relativePath )
-	{
-		var file = new File( CKPACKAGER.packDir, relativePath );
-		return file.getAbsolutePath();
-	},
-
-	getPackagerPath : function( relativePath )
-	{
-		var file = new File( CKPACKAGER.dir, relativePath );
-		return file.getAbsolutePath();
-	},
-
-	_loadedCode : {},
-
-	loadCode : function( path )
-	{
-		if ( this._loadedCode[ path ] )
-			return;
-
-		load( CKPACKAGER.getPackagerPath( path ) );
-	},
-
-	tools :
-	{
-		readFile : function( file )
-		{
-			var data = readFile( file );
-
-			// Remove the UTF-8 BOM.
-			return data.replace( /^\xEF\xBB\xBF/, '' );
-		},
-
-		getFileName : function( file )
-		{
-			file = new File( file );
-			return file.getName();
-		}
-	}
-};
+load( packagerPath + "/includes/ckpackager.js" );
 
 function error( msg )
@@ -109,4 +66,6 @@
 })();
 
+CKPACKAGER.outputDir = CKPACKAGER.packDir;
+
 CKPACKAGER.loadCode( 'includes/packager.js' );
 
Index: /CKPackager/trunk/includes/ckpackager.js
===================================================================
--- /CKPackager/trunk/includes/ckpackager.js	(revision 2888)
+++ /CKPackager/trunk/includes/ckpackager.js	(revision 2888)
@@ -0,0 +1,60 @@
+/*
+Copyright (c) 2003-2008, Frederico Caldeira Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+*/
+
+var CKPACKAGER =
+{
+	dir : (function()
+		{			
+			var packagerDir = new File( System.getProperty( 'java.class.path' ) );
+			return packagerDir.getParent();
+		})(),
+
+	getPackPath : function( relativePath )
+	{
+		var file = new File( CKPACKAGER.packDir, relativePath );
+		return file.getAbsolutePath();
+	},
+
+	getOutputPath : function( relativePath )
+	{
+		var file = new File( CKPACKAGER.outputDir, relativePath );
+		return file.getAbsolutePath();
+	},
+	
+	getPackagerPath : function( relativePath )
+	{
+		var file = new File( CKPACKAGER.dir, relativePath );
+		return file.getAbsolutePath();
+	},
+
+	_loadedCode : {},
+
+	loadCode : function( path )
+	{
+		if ( this._loadedCode[ path ] )
+			return;
+
+		load( CKPACKAGER.getPackagerPath( path ) );
+		
+		this._loadedCode[ path ] = true;
+	},
+
+	tools :
+	{
+		readFile : function( file )
+		{
+			var data = readFile( file, "UTF-8" );
+
+			// Remove the UTF-8 BOM.
+			return data.replace( /^\xEF\xBB\xBF/, '' );
+		},
+
+		getFileName : function( file )
+		{
+			file = new File( file );
+			return file.getName();
+		}
+	}
+};
Index: /CKPackager/trunk/includes/packager.js
===================================================================
--- /CKPackager/trunk/includes/packager.js	(revision 2887)
+++ /CKPackager/trunk/includes/packager.js	(revision 2888)
@@ -41,5 +41,5 @@
 					error( 'The "output" value must be set for all packages in the packager defintion file(' + CKPACKAGER.packFile + ').' );
 
-				var packFile = new CKPACKAGER.packageFile( CKPACKAGER.getPackPath( packDefinition.output ) );
+				var packFile = new CKPACKAGER.packageFile( CKPACKAGER.getOutputPath( packDefinition.output ) );
 
 				if ( definitionObject.header )
