I am trying set the value of a URL instance variable as the classpath but I am getting the below error:
Exception in thread "main" java.net.MalformedURLException: unknown protocol: classpath
at java.net.URL.<init>(URL.java:600)
at java.net.URL.<init>(URL.java:490)
at java.net.URL.<init>(URL.java:439)
at com.foodprocessor.App.main(App.java:18)
C:\Users\admin\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1
BUILD FAILED (total time: 0 seconds)
This is my code:
public class App {
public static void main(String[] args) throws MalformedURLException{
MyEnvironmentA env = new MyEnvironmentA(new URL("classpath:"+System.getProperty("java.class.path")));
env.run("ChocolateMilk");
}
}
Where am I going wrong?