Results 1 to 16 of 16
- 07-28-2008, 09:13 AM #1
Member
- Join Date
- Jul 2008
- Posts
- 4
- Rep Power
- 0
Building projects with the JRE (not the JDK) in Eclipse
Hi,
Just curious. I noticed in the Eclipse documentation the following:
By default, the JRE used to run the workbench will be used to build and run Java programs. It should appear with a checkmark in the list of installed JREs. We recommend that you use a Java SDK instead of a JRE. An SDK is designed for development and contains the source code for the Java library, easing debugging.
How does this work? Does this mean you can compile code with the JRE? My understanding is that you can only compile using "javac".
Any ideas?
Thanks
- 07-28-2008, 09:24 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
I think you know about the meaning of two terminologies. JDK(Java Development Kit) and the JRE(Java Runtime Environment). As it said, you need JDK installed in your machine to develop Java applications. To run a Java application you need the runtime environment, you must.
Using JRE you can't develop any Java application. But if you have JDK installed then you can develop as well as run Java applications. That's JDK includes the JRE also.
Hope it's clear to you.
- 07-28-2008, 09:37 AM #3
Member
- Join Date
- Jul 2008
- Posts
- 4
- Rep Power
- 0
Thanks for the quick reply!
I had the JRE1.6 installed when I first got my home computer (to run misc. Java apps on my home computer). In the JRE1.6 bin/ directory, there is no "javac" compiler.
I installed Eclipse today and was surprised to find that I was able to compile java code... despite the fact that the JRE is missing the java compiler.
To double check I didn't have a JDK installed on my computer, I did a search for "javac" and there was no results.
So I was just wondering how this could possibly be happening. Could Eclipse be using my compiler-less JRE1.6 to build code? Doesn't sound right, but I can't think of any otherway this is happening.
Thanks
- 07-28-2008, 10:09 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
You said that, without having install the JDK package you can compile a Java project in Eclipse? But you can't run it? It can't happened, if you install JDK then there should be JRE too. B
By the way did you installed complete Eclipse package?
- 07-28-2008, 04:55 PM #5
Member
- Join Date
- Jul 2008
- Posts
- 4
- Rep Power
- 0
I said that without having installed the JDK, and only having JRE1.6 installed, I can compile Java code in Eclipse. My thoughts are that if I don't have the JDK, then I shouldn't be able to build anything. Since I have a JRE, then I should be able to run it.
In my first post, I posted an excerpt from the Eclipse documentation. It sounds like you don't need a JDK, but you can compile with the JRE?
- 07-28-2008, 08:13 PM #6
What program does eclipse use to compile java source?
It must include a JDK in its install.
The JRE doesn't include the javac and jar programs.
- 07-29-2008, 03:30 AM #7
Member
- Join Date
- Jul 2008
- Posts
- 4
- Rep Power
- 0
It doesn't appear come with a JDK ... the prerequisite to run Eclipse is having either a JRE or JDK installed on the system.
I have JRE1.6 and despite having searched my system for the javac compiler, I couldn't find it... yet somehow... my small java test (Hello World) is still compiling.
- 09-22-2008, 01:50 PM #8
Member
- Join Date
- Sep 2008
- Posts
- 3
- Rep Power
- 0
I have the same doubt with zachwong.
Only JRE installed, but eclipse is able to compile your java file.
After searching, I got a word "jrew". Someone said that jrew is another kind of binary version of javac and some other files contained in JDK.
And Eclipse uses this tool to compile java file without JDK installed.
- 09-22-2008, 01:56 PM #9
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 09-22-2008, 02:00 PM #10
Member
- Join Date
- Sep 2008
- Posts
- 3
- Rep Power
- 0
- 09-22-2008, 02:05 PM #11
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
- 09-22-2008, 02:08 PM #12
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Not only in Java, in any language to compile the source code you need a compiler. It's must.
As I said earlier there should be another compile attached to the Eclipse. But sorry I can't comment on that. Because I'm not an Eclipse user. ;) May someone else can comment on this, or may be there are more information about that this in Eclipse web site.
- 09-22-2008, 02:20 PM #13
Member
- Join Date
- Sep 2008
- Posts
- 3
- Rep Power
- 0
Hi Eranga,:)
I have find one excellent article about Eclipse Compiler. But I can't post a link here with only 2 replys...I've just send the link to you by private message, Could you post the link in this post for me?
Thx a lot!
ONJava.com -- What's New in Eclipse 3.2 Java Development ToolsLast edited by Eranga; 09-22-2008 at 02:35 PM. Reason: Adding a link by user request. It's related to this post directly.
- 09-29-2008, 09:46 PM #14
Senior Member
- Join Date
- Sep 2008
- Posts
- 135
- Rep Power
- 0
Eclipse has its own compiler
Eclipse is a Java app, hence it needs a JRE to run. But it uses its own internal, incremental compiler - ECJ - rather than javac. You can persuade it to use other compilers, but it's rarely worth the effort
- 09-29-2008, 09:48 PM #15
Senior Member
- Join Date
- Sep 2008
- Posts
- 135
- Rep Power
- 0
- 09-30-2008, 03:50 AM #16
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Just search on the Google as java compilers, you can have a list, may be some of them never seen before.
Similar Threads
-
Java Projects
By yiweiang in forum New To JavaReplies: 2Last Post: 12-15-2011, 01:28 AM -
Group Projects
By Zosden in forum Advanced JavaReplies: 11Last Post: 06-03-2008, 03:47 AM -
Projects please
By sudhir in forum IntroductionsReplies: 1Last Post: 12-17-2007, 01:42 PM -
Java Projects
By Zeke886 in forum New To JavaReplies: 0Last Post: 11-14-2007, 08:41 PM -
Building A Java Project In Eclipse
By JavaForums in forum EclipseReplies: 0Last Post: 05-22-2007, 09:34 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks