Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Newbie needs help trying to use Geany portable

Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'm starting out in Java programming but have no prior knowledge in any programming language. I'm trying to use Geany portable. The problem is I can't run even the Hello World program.

I was able to save the source file as but I cannot compile nor run it.
Here's what I see on the compiler message window when I click on "Compile":

javac "" (in directory: C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Portalet\GeanyPortable\App\Geany)

And then the status bar reads "Process failed (The system cannot find the file specified)"

I tried to run the program and this is what I get:

"Exception in thread "main" java.lang.NoClassDefFoundError: MyFirstJavaProgram
Caused by: java.lang.ClassNotFoundException: MyFirstJavaProgram
at$ Source)
at Method)
at Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: MyFirstJavaProgram. Program will exit."

I've done no initial setting up of preferences, so I just ran Geany after installation.

I hope someone would be kind enough to help and explain these to me.
Thank you in advance!

Java Cowboy
Posts: 16084
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where did you save your source file?

According to the error message, the Java compiler cannot find your source file. And if the compiler can't find it, it also cannot compile it, and when you then try to run the program it isn't going to work because you need to successfully compile it first. You'll have to configure Geany so that it directs the compiler to look at the correct location for your source file.

Maybe it's better to try compiling and running from the command prompt window first. Oracle's Hello World tutorial explains how to do that step by step.
dab yabao
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The source file is on this location:

C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\Portalet\GeanyPortable\App\Geany

So Geany saves the source file in a folder within its installation folder. I've been trying to figure out why the compiler could not locate the file when it's being displayed on the 'Files' tab on the left of the editor.

One more question. It says on Geany's web page that this: 'Build system to compile and execute your code' is one of Geany's basic features. Does this mean that with Geany I don't need to install a separate compiler?

I used Geany because I'm working on a computer that has administrator restrictions with regards to installing applications/soft wares. That is why if you noticed, I had Geany installed in my local folder. Hehe.

Thank you for your reply. I will look into Geany's configuration and see if I can figure out how to direct the compiler to the source file's location.

I love a good mentalist. And so does this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic