Can I develop Java programs if I have only JRE installed?

前端 未结 10 997
执笔经年
执笔经年 2020-12-19 03:36

I have JRE 1.7 installed on my system. Due to some admin issues I don\'t have JDK on my system. is there any way I can develop Java programs with JRE only?

相关标签:
10条回答
  • 2020-12-19 04:14

    Eclipse includes its own compiler and doesn't depend on the JDK compiler. But indeed, the JRE is just the runtime environment and doesn't include the compiler or other development tools.

    0 讨论(0)
  • 2020-12-19 04:16

    No you can't develop java programs only with JRE

    You will need JDK for compiling your programs.JRE provides only runtime environment,but JDK is something you will need to compile your code to make them executable by your JRE.You will need javac for compiling your code which is present in JDK.

    enter image description here

    However for resolving the issue of admin rights you are having, you can download and install eclipse which has its own built in compiler.

    0 讨论(0)
  • 2020-12-19 04:21

    I request you to resolve admin rights. Else I have two options for you.

    1) You cannot do anything without Java Development Kit.Hope this diagram makes why its not possible

    2)You can install a IDE to code Java which makes your work in the current situation simpler. Use Eclipse or NetBeans. I would recommend Eclipse to you anyway. You can download eclipse from this link https://www.eclipse.org/downloads/

    Try downloading JDK from this http://www.oracle.com/technetwork/java/javase/overview/index-jsp-138218.html.

    Hope this helps you.

    0 讨论(0)
  • 2020-12-19 04:22

    the answer is somehow "yes,but..."

    java source code execution procedure is split into 2 steps :

    1)compiling the source code into a byte-code,thus generating the .class file

    2)interpreting the VM specific instructions from the .class file into native instructions

    .java----javac---->.class----java---->native code

    needless to mention that the "javac" , the compiler of the java source code is in not part of the JRE!

    so in order to develop java programs without JDK you have to skip the first step and keep using exclusively the "java" tool,thus dealing directly with byte-code !

    in some extent and if you're acquainted with the JVM internals,it's possible to write some lines of byte-code using hex or text editors and then running the .class file;but you will not go further then that specially when it comes to creating complex applications as this require super-human capabilities :that's a highly daunting task .

    nevertheless,todays java frameworks almost all use direct byte-code manipulation and tools like the asm framework or javassit

    javassist does not require the JDK and you can generate a class from scratch and then compile/run it

    java -classpath .:javassist-x.x.jar test "some arguments"

    (no need to compile classes)

    but again,that is only for restricted use and in order to develop java applications you have to use some JDK... finally,you have to strive to acquire full control upon what is running in you machine;recent frameworks are resource-greedy and needs a huge amount of resources(disk space,memory...) and many tools and framworks require full control,i mean administrator right : for instance i remember that once a time borland delphi refused to start and i had to give it full access rights to start...

    0 讨论(0)
提交回复
热议问题