Eclipse : How to kill an ever running Java program

Done with day 3. Finished off the basic constructs. I so want to go back to college!! As I go through the udemy course, a lot of my previous memories come back rushing.  Anyway, here is what I’ve learnt today :  Killing an ever running Java program in eclipse.

When you initiate through DOS, you can use ctrl+ c.  With eclipse, its even easier with a visual.  The console section has a right colored rectangular box which you can click to stop the program.

 

 

Image

 

If you want to kill javaw.exe instead ( case of multiple instances running) – go to Task Manager.

Have a good day and keep rocking!!

Advertisements

Life Hacks # 1 : The perfect solution to Never Ending Lists

My mind plays  lot of dirty tricks and there are few prominent ones I am only beginning to realize offlate. To combat them, I have started my own secret mission and have consistently used one trick against it, atleast to shut down temporarily. Image   One of my biggest problems is to make ever lengthy lists. I have any.do installed everywhere, and keep adding to the lists and they come and haunt me like a nasty past.  The diligence I have in adding to the list goes into hiding, while executing it.  Then comes the time to be overwhelmed looking at the list.  It is hard to admit publicly, but the list making is one of the best boons and worst banes of my life. Eventually, everything gets done but not after I beat myself up for missing the deadlines, every single time. I finally figured out a simple solution –

Anything that can be done NOW in 2 minutes should be done – Instead of going into the list

It was hard initially. Cleaning comb. The rim of the glass bottle. Responding to a quick facebook message.  NOW! Slowly, I realized the power in doing this.  I tell my mind back that I am no more the person creating useless lists, but actually follow through. A Lot of power is in ACTION. Also, I started using any.do smartly and now apart from “Today” – there are quite lot of entries in “Some day” or “Next Week”, which keeps my mind and mobile battery free for useful stuff. If you have a problem similar to mine, give this a try. It will surely be useful. Have a good day and keep rocking!! Image Credit : http://www.mortylefkoe.com/wp-content/uploads/2014/01/bigstock-Concept-for-procrastination-an-51568768.jpg

Eclipse Error : The method printf(String, Object[]) in the type PrintStream is not applicable for the arguments (String, String, String)

So, my 2nd error to document already.  printf is an alternative to println and can be used to print stuff on the screen.

What’s wrong with this code?

public class ForLoop{

public static void main(String[] args) {

for(int i = 0;i < 10;i++) {
//System.out.println(“The value of i is ” + i);
System.out.printf(“The value of i is %d\n”, i);
// System.out.println();
System.out.printf(“test – %d”, i);
}
}
}

javac.exe compiles it well, but eclipse keeps throwing the nasty error.  So, you know it’s one of Eclipse’s quirky traits and some settings need to be modified. Here are the setting changes required –

java eclipse error

Project -> Properties -> Java Compiler -> Enable Project Specific Settings.

Set Compiler Compliance Level to 1.5

The error vanishes now. Happy Coding! 🙂

Eclipse error: Unbound classpath container

To get myself back on track and deal with things that haven’t exactly gone as planned – I have started refreshing core java concepts and have planned a bigger track of things to complete in this space.  The company I work with has some great product ideas and what better than learn stuff and get your hands dirty! Targeting Java Developer Certification Early July.  My companion currently is Udemy course I started yesterday. I will be documenting stuff as I learn along – to serve myself later times should I forget.

Eclipse error: Unbound classpath container

Solution:

Go to : Projects -> Properties -> Java Build Path -> Libraries 

select the one mentioned,and click ‘Edit’.

Try selecting Alternate jre or Workspace default jre and click ok.

For me, selecting Alternate jre solved the problem.

Also, one thing I learnt during Installation process  ->

If you want to run Java programs without developing – just install JRE.

If you want to develop Java programs, install JDK which comes with JRE. 

So, later if you get the above said minor errors, you can always troubleshoot.

Have a good day and keep rocking!!

Recipe : barley khichadi

image

While i get to spend time at home more now, naturally my attention has turned to cooking. Barley is one of the things i wanted to cook from quite long and finally managed to do it now.

Barley khichadi

Ingredients
Barley – 150 gm soaked for 4 hours and pressure cook for 4 whistles
Groundnut and til – roasted and fried 4-5 tbsp
Mustard, cumin – 1 tsp each
Green chilli – 4
Potato sliced – 1
Cucumber sliced – 1
Lemon – 1
Coriander leaves – 1 sprig
Jeera powder – 1 tsp
Salt, haldi – to taste

Method
1. Take pan and add mustard and cumin.
2. Add potato and let it cook.
3. Add cucumber and let it ooze water.
4. Add barley,  groundnut til powder, jeera powder, salt and haldi.
5. Mix well for 5 mts
6. Switch off, add lemon juice and coriander sprigs.

Serve hot. Total cooking time is 15 mts, apart from cooking barley on the cooker.

Everyone in my family loved it, tastes very similar to sabudana khichadi. Give a try and let me know 🙂

Have a great day and keep rocking!!!

Recipe : cashew halwa

image

Vinod is  back home after couple of months and it definitely deserves a celebration. Although things were good so far, now they will be great just  because he will be around.

A dessert to celebrate vinod’s coming back : cashew halwa

Ingredients
Cashew 200 gms
Natu ravva 50 gms
Ghee 5 tbsp
Milk 100 ml
Sugar 100 ml
Elaichi 10

Method
1.  Grind cashews to a coarse powder
2. Take a pan, add some ghee and add natu ravva. Fry until it turns red.
3. Add cashew powder and fry for 2 mts.
4. Add sugar and milk.
5. Let the halwa come close.
6. Add elaichi powder and mix well.

My family eats a lot less sweet, so feel free to adjust the sugar accordingly. The taste is heavenly, and you can easily eat a bowlful without feeling heavy.

Do give a try and let me know how it turned out.

Have a good day and keep rocking!!

How to fix: iPod icon disappears from iTunes

Now, with some free time on my hands and getting an earful for not being calmer, I decided to dust the iPod 64 GB which my dad had gifted for  our anniversary few years back.  When I connected it to the new laptop, something really weird happened.

The iPod button on the right hand side appears, and as soon as I click it – it just disappears!!  Youtube gave me couple of useless fixes, which I tried in vain. Finally – the eureka moment came when I decided to “Sync” first 😀

And then after that, when I clicked ‘iPod’, it promptly opened what’s in my iPod to me. Success!

so – next time, when you connect your iDevice to a new computer – sync first. And then, try opening the device.