elective-stereophonic
elective-stereophonic
Trying to build and run the code.... Can't find nxt-default.properties? singapore
Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Nxt Client: Nxt 1.11.15

Author Topic: Trying to build and run the code.... Can't find nxt-default.properties?  (Read 3345 times)

_mr_e

  • Hero Member
  • *****
  • Karma: +88/-18
  • Offline Offline
  • Posts: 956
    • View Profile

When I try to run all the loads of nxt-default.properties are coming back null. I see it there in the conf folder and I seem to be able to force load by putting the path right in the inputstream but why can't I just run the latest code as is? Although when I do that I start receiving this error:

Exception in thread "Thread-0" java.lang.NoClassDefFoundError: Could not initialize class nxt.db.Db
   at nxt.Nxt.shutdown(Nxt.java:157)
   at nxt.Nxt$1.run(Nxt.java:136)
   at java.lang.Thread.run(Thread.java:745)
Logged

_mr_e

  • Hero Member
  • *****
  • Karma: +88/-18
  • Offline Offline
  • Posts: 956
    • View Profile
Re: Trying to build and run the code.... Can't find nxt-default.properties?
« Reply #1 on: October 16, 2014, 01:24:59 am »

can anyone help with this? Is there something I need to set up before I can run? My main exposure to java is Android apps so I'm a bit uncertain if I'm missing something.
Logged

nxtrules

  • Sr. Member
  • ****
  • Karma: +15/-1
  • Offline Offline
  • Posts: 254
    • View Profile
Re: Trying to build and run the code.... Can't find nxt-default.properties?
« Reply #2 on: October 16, 2014, 03:23:55 am »

Not exactly sure but looks like something with db.

Some suggestions:

1)Kill the nxt/java process
Delete everything in nxt_db folder
Start nxt

2) delete all and install 1.3.0

I am on ubuntu 13.10 and didn't have any issues upgrading to 1.3.0. No special configs

Logged
http://nxtrules.mooo.com {NXT investment tracking with multiple account support}

_mr_e

  • Hero Member
  • *****
  • Karma: +88/-18
  • Offline Offline
  • Posts: 956
    • View Profile
Re: Trying to build and run the code.... Can't find nxt-default.properties?
« Reply #3 on: October 16, 2014, 01:06:22 pm »

I am trying to build and run from the source code which I have imported into intellij. I downloaded directly from the bit bucket repo.
Logged

VanBreuk

  • Administrator
  • Hero Member
  • *****
  • Karma: +362/-19
  • Offline Offline
  • Posts: 2772
    • View Profile
Re: Trying to build and run the code.... Can't find nxt-default.properties?
« Reply #4 on: October 16, 2014, 01:14:33 pm »

Might be a Java class path issue.

What do you get with

Code: [Select]
java -version
?
Logged
GPG Fingerprint: B020 D1C1 F289 3B2C 3577  9EAD 455D D175 5913 C7F1

_mr_e

  • Hero Member
  • *****
  • Karma: +88/-18
  • Offline Offline
  • Posts: 956
    • View Profile
Re: Trying to build and run the code.... Can't find nxt-default.properties?
« Reply #5 on: October 16, 2014, 08:09:15 pm »

java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

I am using intelliJ. I imported the project but I notice it does not add the /conf folder to my project. How can I tell intelliJ to look in there?

When I step through the code in Nxt.java both lines:

InputStream is = ClassLoader.getSystemResourceAsStream("nxt-default.properties")
and
String configFile = System.getProperty("nxt-default.properties");

return null.
Logged

starik69

  • Sr. Member
  • ****
  • Karma: +11/-17
  • Offline Offline
  • Posts: 301
    • View Profile
Re: Trying to build and run the code.... Can't find nxt-default.properties?
« Reply #6 on: October 16, 2014, 10:47:03 pm »

Oh, i tried IntelliJ too.  ::)
It made me 6Mb nxt.jar which did not started.  :'(
While Eclipse or NetBeans compiled well enough...  :)
Logged
NXT-R2U6-22MC-LQL2-22222 (648774468) - NXT | All versions of NXT client and more - https://mega.co.nz/#F!J1xmgAyC!cnaqdxHALLMGiS0hTPrhAg

_mr_e

  • Hero Member
  • *****
  • Karma: +88/-18
  • Offline Offline
  • Posts: 956
    • View Profile
Re: Trying to build and run the code.... Can't find nxt-default.properties?
« Reply #7 on: October 16, 2014, 10:53:11 pm »

It's compiling and running... it's just not finding the properties file in the class path.  Being a windows based android developer I've never used this classpath before so I must be missing some basic setup.
Logged

starik69

  • Sr. Member
  • ****
  • Karma: +11/-17
  • Offline Offline
  • Posts: 301
    • View Profile
Re: Trying to build and run the code.... Can't find nxt-default.properties?
« Reply #8 on: October 16, 2014, 11:14:01 pm »

May be use something like filemonitor to look where it is expecting that file to be and then put it there?
Logged
NXT-R2U6-22MC-LQL2-22222 (648774468) - NXT | All versions of NXT client and more - https://mega.co.nz/#F!J1xmgAyC!cnaqdxHALLMGiS0hTPrhAg

jones

  • Hero Member
  • *****
  • Karma: +310/-8
  • Offline Offline
  • Posts: 1043
  • write code not war
    • View Profile
    • jNxt
Re: Trying to build and run the code.... Can't find nxt-default.properties?
« Reply #9 on: October 17, 2014, 02:43:37 am »

Are you running the compile.sh or just a general ide compile. If you aren't using the bash file, you have to add certain compiler flags to tell the Java compiler where config and db files are
Logged
-- Jones NXT-RJU8-JSNR-H9J4-2KWKY

_mr_e

  • Hero Member
  • *****
  • Karma: +88/-18
  • Offline Offline
  • Posts: 956
    • View Profile
Re: Trying to build and run the code.... Can't find nxt-default.properties?
« Reply #10 on: October 17, 2014, 02:53:21 am »

Ide compile... I looked in the compile.sh and tried to replicate the classpath flag in the intellij environment variables but it still isn't working... I must be close but something is off slightly.
Logged

jones

  • Hero Member
  • *****
  • Karma: +310/-8
  • Offline Offline
  • Posts: 1043
  • write code not war
    • View Profile
    • jNxt
Re: Trying to build and run the code.... Can't find nxt-default.properties?
« Reply #11 on: October 17, 2014, 06:16:39 am »

If you can run compile.sh successfully, you just need to work your way backward with IDE flags until it goes through.

personally I just use the bash file. I've never been fond of having to set all of that up
Logged
-- Jones NXT-RJU8-JSNR-H9J4-2KWKY

Jean-Luc

  • Core Dev
  • Hero Member
  • *****
  • Karma: +816/-81
  • Offline Offline
  • Posts: 1610
    • View Profile
Re: Trying to build and run the code.... Can't find nxt-default.properties?
« Reply #12 on: October 17, 2014, 08:51:31 am »

I am using intelliJ. I imported the project but I notice it does not add the /conf folder to my project. How can I tell intelliJ to look in there?

Googled it for you:
https://stackoverflow.com/questions/854264/how-to-add-directory-to-classpath-in-an-application-run-profile-in-intellij-idea

You need to add the conf folder as a dependency, of type classes.

I also use IntelliJ, but always compile and run from the command line.
Logged
GPG key fingerprint: 263A 9EB0 29CF C77A 3D06  FD13 811D 6940 E1E4 240C
NXT-X4LF-9A4G-WN9Z-2R322

_mr_e

  • Hero Member
  • *****
  • Karma: +88/-18
  • Offline Offline
  • Posts: 956
    • View Profile
Re: Trying to build and run the code.... Can't find nxt-default.properties?
« Reply #13 on: October 17, 2014, 12:52:46 pm »

I am using intelliJ. I imported the project but I notice it does not add the /conf folder to my project. How can I tell intelliJ to look in there?

Googled it for you:
https://stackoverflow.com/questions/854264/how-to-add-directory-to-classpath-in-an-application-run-profile-in-intellij-idea

You need to add the conf folder as a dependency, of type classes.

I also use IntelliJ, but always compile and run from the command line.
Thank you. I will try this out when I get a chance today. When you build and run from the command line how are you able to use intellij's debugging features?
Logged

Jean-Luc

  • Core Dev
  • Hero Member
  • *****
  • Karma: +816/-81
  • Offline Offline
  • Posts: 1610
    • View Profile
Re: Trying to build and run the code.... Can't find nxt-default.properties?
« Reply #14 on: October 17, 2014, 01:16:06 pm »

Thank you. I will try this out when I get a chance today. When you build and run from the command line how are you able to use intellij's debugging features?
For this project, I have never yet had a need to do debugging using a debugger and stepping through code.

In my previous work, I have done debugging by attaching the debugger to the application started outside of the IDE, I think there was some -X command line parameter you need to add to java to make it listen on some port, and then configure debugging as if connecting to a remote application, but running on localhost. It's been a while since I had to do that.
Logged
GPG key fingerprint: 263A 9EB0 29CF C77A 3D06  FD13 811D 6940 E1E4 240C
NXT-X4LF-9A4G-WN9Z-2R322

_mr_e

  • Hero Member
  • *****
  • Karma: +88/-18
  • Offline Offline
  • Posts: 956
    • View Profile
Re: Trying to build and run the code.... Can't find nxt-default.properties?
« Reply #15 on: October 17, 2014, 01:33:09 pm »

Thank you. I will try this out when I get a chance today. When you build and run from the command line how are you able to use intellij's debugging features?
For this project, I have never yet had a need to do debugging using a debugger and stepping through code.

In my previous work, I have done debugging by attaching the debugger to the application started outside of the IDE, I think there was some -X command line parameter you need to add to java to make it listen on some port, and then configure debugging as if connecting to a remote application, but running on localhost. It's been a while since I had to do that.

That's incredible. Especially for such a complex project. I'm a fast coder, usually light years ahead of peers at work but I am addicted to the debugger haha.
Logged
 

elective-stereophonic
elective-stereophonic
assembly
assembly