Hi Sorry for Asking on the Same Question..
I am Running my project in Netbeans
String build_path=getClass().getProtectionDomain().getCodeSource().getLocation().getPath();
command.add(build_path+"i_view32.exe"); command.add(source_p+"/import_pal="+pal_file+"/convert="+ Dest_p+"");
This is Working fine in NetBeans but When i am Running the build from command prompt
java -jar "D:\Pallete\dist\Pallete.jar"
Gives me Following Exception:
java.lang.NullPointerException
at pal.btn_OkActionPerformed(pal.java:214)
at pal.access$100(pal.java:22)
at pal$2.actionPerformed(pal.java:85)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
When I click on Ok Button it throws Exception at line 214
public static String jarpath ;
public static String buildpath;
buildpath = getClass().getClassLoader().getResource("").getPath();
jarpath=getClass().getProtectionDomain().getCodeSource().getLocation().getPath()
If line 214 is
getClass().getClassLoader().getResource("").getPath();, andgetResource("")is the actual code, then this is failing. It tries to call
getPath()on a null object.