When trying to write for the Java Platform i get many exception messages of type ClassNotFoundException and when i try to create graphic context i get the error FileNotFoundException.
See [1723] Default new project with Swift and Java prints excessive errors for the first part. Those are expected. Java throws a bunch of (caught) exceptions when running an app, and because you are running in the debugger these show a message (but don’t break, because the debugger is set to ignore these two exceptions, because they are expected). But we’ll review options for how to make this more obvious and handle this even better.
As for the error creating a graphic context — can you send us a complete project that shows this?
Thanx,
marc
Tried to compile the java project with release setting but the ClassNotFoundException still shows up as well and as you can see the FileNotFoundException happens to in a very simple project. Musikverwaltung.zip (117.8 KB)
right, it doesn’t matter what you compile as the Java runtime will always throw (and catch) these exceptions as the app launches. You only see them because you are running the app side the debugger.
reproduced, i’ll log an issue for this. thanx! it looks like it needs but can’t find sunrsasign.jar
, whatever that is. I can’t see any such jar file in my Java install…
Thanks, logged as bugs://71566
Yes it seems like that. and didn’t found that jar file as well in my install of java.
I took a look at your code; And it DOES work fine, even if I put code after the canvas creation, it works fine. This seems to be some assembly scanning code that Java uses when initializing the canvas the first time. It’s nothing to worry about and best to be ignored.
bugs://71566 got closed with status nochangereq.
How should i ignore the error when the program doesn’t launch.
What do you mean? I tried your testcase and added a print(“Hello world”) after the Canvas() and it printed it just fine.
i mean that i can’t load any graphic component. because the execution stops before the Java environment get loaded. End even a print or println command doesn’t work for me.
It stops with the message URLClassPath$JarLoader.getJarFile() -> java.io.filenotfoundexception for the sunrasign.jar file.
But if you press "continue, does it keep running? it does for me: Image 2015-03-24 at 11.50.4...
You can turn off that the debugger stops on Exceptions a all, via the Debug|Stop on Exceptions menu.
But really, these are just a part of I’ve on Java. You;d get the exact same exceptions, if you were writing this code in Oracle’s Java language compiler and running int in a debugger.
package javaapplication1;
import java.awt.Canvas;
/**
*
-
@author peter
*/
public class JavaApplication1 {static java.awt.Canvas myCanvas;
/**-
@param args the command line arguments
*/
public static void main(String[] args) {
myCanvas = new Canvas();
}
-
@param args the command line arguments
}
this would be the program written in java-language in netbeans. When i debug this i get exactly 0 exceptions.
Sure you have NetBeans set to break on exceptions?
yes. and it didn’t creates these exceptions at all.
Could not load a dependent class (javax/media/jai/PlanarImage) for type image
Could not load class (org.apache.tools.ant.taskdefs.repository.MavenRepository) for type mavenrepository
Could not load a dependent class (jdepend/xmlui/JDepend) for type jdepend
Could not load a dependent class (javax/media/jai/PlanarImage) for type image
Could not load class (org.apache.tools.ant.taskdefs.repository.MavenRepository) for type mavenrepository
Could not load a dependent class (jdepend/xmlui/JDepend) for type jdepend
these are the only messages that show up when i debug the program but that didn’t prevents the program from starting and finishing without user actions
Not sure what to tell you. Maybe Netbeans handles it differently what exceptions it shows you and which it doesn’t (and I’ll fix Fire to not stop on java.io.FileNotFoundException
for the next build), but those exceptions are there — they aren’t generated by us or by the Silver compiler, but by the Java runtime, and are normal and expected. Again — if you run tour application outside of the debugger (or turn off to break on exceptions), it will run just fine.
—marc