Solved

Running/Compiling *.java (Java 5.0) file in Oracle Sql Devleloper

Posted on 2007-03-27
12
1,203 Views
Last Modified: 2013-12-12
I have installed Oracle Sql Developer 1.1.2.25.70 with Java Platform 1.5.0_10 on Fedora 5.

Is it possible to compile and run a *.java file without connecting the Oracle Sql Developer to a database?

If it is possible how do i do this?
0
Comment
Question by:gram77
  • 7
  • 5
12 Comments
 
LVL 20

Expert Comment

by:gatorvip
ID: 18800067
I don't really understand your question. You want to compile a .java file in SQL Dev? That's not what the app is for...  Also, SQL Dev doesn't come with the JDK, just the JRE.
0
 

Author Comment

by:gram77
ID: 18800093
So you mean you can't develop java applications in Oracle Sql Developer.

Oracle Sql Developer needs JDK preinstalled. before installing Sql Developer.
0
 

Author Comment

by:gram77
ID: 18800101
However, Sql Developer is able to understand all Java Keywords correctly as it prints them i blue..
0
 
LVL 20

Accepted Solution

by:
gatorvip earned 500 total points
ID: 18800239
If you have the JDK preinstalled, you don't *need* SQL Developer to compile .java files. You can use notepad for that, in the worst case. SQL Developer is to be used for database development, running queries, etc.

http://www.oracle.com/technology/products/database/sql_developer/index.html

***
 Oracle SQL Developer is a free graphical tool for database development. With SQL Developer, you can browse database objects, run SQL statements and SQL scripts, and edit and debug PL/SQL statements. You can also run any number of provided reports, as well as create and save your own. SQL Developer enhances productivity and simplifies your database development tasks.
****

However, if you *really* want to use SQL Dev for java compilation, you can customize behavior under Tools/Preferences.
- Tools/External Tools/New then enter the path to the javac.exe compiler you want to use
0
 
LVL 20

Expert Comment

by:gatorvip
ID: 18800250
You can definitely customize SQL Dev to recognize keywords, Tools/Preferences/Code Editor/Syntax Colors
0
 

Author Comment

by:gram77
ID: 18800574
gatorvip:

I addes javac as an external tool.

It shows in the Tools menu as well as the context menu on right clicking.

It compiles the java program well.

However, when i run the .java program, it raises the error:

"The target cannot be started because there is no active project"
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:gram77
ID: 18800748
well i have added java i.e.
/usr/java/jre1.5.0_10/bin/java as an external tool too.

However, when i run Writer2.java class file, i get the following error.
/usr/java/jre1.5.0_10/bin/java /mnt/win/linux_bkup/scripts/java/Writer2
Exception in thread "main" java.lang.NoClassDefFoundError: /mnt/win/linux_bkup/scripts/java/Writer2

/usr/java/jre1.5.0_10/bin/java Writer2
Exception in thread "main" java.lang.NoClassDefFoundError: /mnt/win/linux_bkup/scripts/java/Writer2
0
 

Author Comment

by:gram77
ID: 18800778
However, in Fedora Terminal Window, i get the desired result:
[root@localhost java]# /usr/java/jre1.5.0_10/bin/java Writer2
12
howdy
folks
0
 
LVL 20

Assisted Solution

by:gatorvip
gatorvip earned 500 total points
ID: 18801601
you will have to modify your classpath for your executables to work
0
 

Author Comment

by:gram77
ID: 18801803
gatorvip:
Modify the classpath in Fedora or Sql Developer.
You mean i should change the classpath in Sql Developer to the resemble classpath in Fedora?
0
 
LVL 20

Expert Comment

by:gatorvip
ID: 18802966
well, you can use it as a parameter directly in SQL Dev:

java -cp <your_classpath> (don't forget to include the current directory ".")
0
 

Author Comment

by:gram77
ID: 18813422
gatovip:
Wow! i am able to work on java using Oracle Sql Developer.

I am able to compile and run java source files :)

Many Thanks.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now