Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » How do I do this?
How do I do this? [message #899687] Wed, 01 August 2012 16:46 Go to next message
Edward Rech is currently offline Edward Rech
Messages: 4
Registered: July 2012
Junior Member
How do I do this in eclipse (like on pic)?

EDIT: I mean these two :
javac Test.java
java Test Hello, World.

How do I do this? :/

index.php/fa/10974/0/

[Updated on: Wed, 01 August 2012 16:51]

Report message to a moderator

Re: How do I do this? [message #899726 is a reply to message #899687] Thu, 02 August 2012 02:34 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26014
Registered: July 2009
Senior Member
From the context menu of the *.java with the main, you can invoke Run
As -> Java Application. If you want to specify arguments, you can use
Run -> Run Configurations... to specify them via the Java Application's
run configuration.

On 01/08/2012 10:46 PM, Edward Rech wrote:
> How do I do this in eclipse (like on pic)?
Re: How do I do this? [message #899833 is a reply to message #899726] Thu, 02 August 2012 09:55 Go to previous messageGo to next message
Edward Rech is currently offline Edward Rech
Messages: 4
Registered: July 2012
Junior Member
Here's what I got!


Exception in thread "main" java.lang.NoClassDefFoundError: javac
Caused by: java.lang.ClassNotFoundException: javac
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)


I put this in the VM thing. In the program thing it just pasted the code and did nothing at all
Re: How do I do this? [message #899887 is a reply to message #899833] Thu, 02 August 2012 13:31 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 26014
Registered: July 2009
Senior Member
You mean the VM arguments in the Run Configuration? You'd specify your
arguments for main in the Program arguments section.


On 02/08/2012 3:55 PM, Edward Rech wrote:
> Here's what I got!
>
>
> Exception in thread "main" java.lang.NoClassDefFoundError: javac
> Caused by: java.lang.ClassNotFoundException: javac
> at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
>
>
> I put this in the VM thing. In the program thing it just pasted the
> code and did nothing at all
Re: How do I do this? [message #900412 is a reply to message #899833] Mon, 06 August 2012 18:09 Go to previous message
Steve Blass is currently offline Steve Blass
Messages: 276
Registered: July 2009
Senior Member
Edward Rech wrote on Thu, 02 August 2012 09:55
Here's what I got!


Exception in thread "main" java.lang.NoClassDefFoundError: javac
Caused by: java.lang.ClassNotFoundException: javac
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)


I put this in the VM thing. In the program thing it just pasted the code and did nothing at all


When using Eclipse you do not have to invoke javac Test.java yourself. Javac is the standard command line java compiler. In Eclipse you either check 'Build Automatically' in the Project menu OR you choose 'Build Project' OR you right-click the project name and choose 'Build Project'. That will compile your java code into classes and place it in a hidden bin folder in your project tree. Then to run the program you can right click the project and choose 'Run-As' -> Java application. That is the equivalent of the command line command 'java Test'. Note that if you have 'Build Automatically' checked then those 'Build Project' options will be greyed out or missing.

To run your test program with the arguments Hello, World you can use the Run menu 'Run-configurations' choice to 1) create a new java application config, 2) put Hello and World in to the program arguments dialog, 3) Run

[Updated on: Mon, 06 August 2012 18:13]

Report message to a moderator

Previous Topic:Eclipse vs. Platform vs SDK: what is the difference?
Next Topic:Intel tool chain for Remote C/C++ project
Goto Forum:
  


Current Time: Sat Aug 30 06:28:26 EDT 2014

Powered by FUDForum. Page generated in 0.02520 seconds