aspose file tools
The moose likes Beginning Java and the fly likes Newbie needs help trying to use Geany portable Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Newbie needs help trying to use Geany portable" Watch "Newbie needs help trying to use Geany portable" New topic
Author

Newbie needs help trying to use Geany portable

dab yabao
Greenhorn

Joined: Jun 22, 2012
Posts: 2

Hi,

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 MyFirstJavaProgram.java but I cannot compile nor run it.
Here's what I see on the compiler message window when I click on "Compile":

javac "MyFirstJavaProgram.java" (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 java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown 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!

-dub16
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12924
    
    3

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.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
dab yabao
Greenhorn

Joined: Jun 22, 2012
Posts: 2


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 agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Newbie needs help trying to use Geany portable
 
Similar Threads
Error when running a class
Packages
JFreeChart installation problem
connecting to an MS SQL server
Basic Hello World Program not working