I am trying to find the path of resource using Paths like below and then copying some files at runtime. While at runtime it works perfectly fine. However while running locally for junit testing, it throws below error at the below first line while trying to get Path using URI. I am not using any zip/jar file so why I am getting the below stack trace. Am I missing something?
Path path= Paths.get(ABCD.class.resource("/").toURI());
File mockFile= new File(path+File.seperator+mockfileName);
at java.nio.file.Paths.get(Unknown Source)
The message is clear, the path it is trying to access does not exist. You need to use the debugger to find out exactly what paths it is trying to find. That is the only way to discover what causes the problem.
Q1. Write a program using methods to find whether a point (x1,y1) lies on a circle of radius 2 cm and h = 5; the equation of circle is given by 〖(x-h)〗^2+〖(y-h)〗^2=r^2 . The method returns a Booleanvalue.
write a recursive function which takes 2 input parameters. The first is an employee id and the second is another employee id. We need this function to check if the second Employee is one of the direct or indirect managers, it must returntrueif the second employee is one of the reporting line for the first employee, otherwise it will returnfalse
Emp Id int primary key,
Name varchar(50) not null,
Manager int references Employee (Emp_ld),
JobTitle int references JobTitle(JTId)
You first have to figure out who's "at the top"; then you can recurse down the "tree": That would be the "one" with NO "Manager" (everyone else MUST have one). If you have more than one without a manager, then you have a leadership problem.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
I am new to Java but I have worked on the Microsoft product stack. Is there a "make" and/or "project" file equivalent in Java and is there such a project file that is only associated with whichever IDE I am using?
I am just an amateur javac user, buidling occasionally some simple applications.
Meaning i dont know much of programming generally.
I will try to express my problem as quick and clearly.
Here it is.
I am using Netbeans.
I have a 'jimakoskx' Project trying to have there all my succesful/interesting classes
that occasionally i may write....in years.
Like my library Project.
Lets say i have there a 'mess' of 200 classes
(library classes meaning some of them importing 'some of them' ..others may be independent etc)
Now lets say that a friend ask me a simple application.
And because of my Library Project i am ready to finish this application
a)Create a new Project
b)Import the Library project (Properties->Libraries->add)
.......(Copy dependencies because i want to give the 'client' the jar file )
c)easy write the new application
My problem is NOT that i must give to client
the FOLDER containing the application.jar and the library jar.
Ok..even if there be some solution ...this is not what made me come here to ask.
My problem and my question is the following.
My application jar use lets say only 1 class of my library jar.
But because the library jar lets say is 2 MB
then i am distributing (for the application) 2 MB (by importing library)
...plus...some KB of the actual ('new') application.
Now...if this is a big problem .....i can solve this
either by manually copy the interesting classes from library to actual project
either by ...(lets say i have nothing to do)...by creating a program that do it for me.
And the question is ... Is there a way doing this in Netbeans ???
Thank in advance...
modified 19-Sep-22 4:51am.
Last Visit: 31-Dec-99 18:00 Last Update: 26-Sep-23 15:41